LDServer icon indicating copy to clipboard operation
LDServer copied to clipboard

[Raremetal-server] Issues with missing masks and encoding

Open abought opened this issue 5 years ago • 0 comments

Summary

We have found two issues with Raremetal-server covariance endpoint:

  1. If any of the masks in a region are empty, the server rejects the entire request.
  2. It seems that the success of the request is partially sensitive to the content-type encoding header sent to the server. (see example below using requests; introspect differences using test.request.headers)

Expected behavior

This is a topic for discussion.

Reproducible test case

In the below example, mask 3 is empty for this region, but all other masks are valid.

#!/usr/bin/env python3
import requests

payload = {
  "chrom":"19",
  "start":45400845,
  "stop":45420845,
  "genotypeDataset":1,
  "phenotypeDataset":1,
  "phenotype":"hdl",
  "samples":"ALL",
  "genomeBuild":"GRCh37",
  "masks":[1,2,3,4,5,6]
}

test = requests.post("https://portaldev.sph.umich.edu/raremetal/v1/aggregation/covariance", json=payload)
print(f"{test.status_code} {test.reason}")
print(test.json())

Interestingly, if the POST request is sent using data= instead of json=, the request will succeed. (due to a different content-type header being sent with the request)

abought avatar May 06 '19 16:05 abought