terraref / brapi

Breeder's API implementation for TERRA-REF
https://terraref.org/brapi/v1/calls
BSD 3-Clause "New" or "Revised" License
0 stars 2 forks source link

Is it necessary to filter observationunits by ObservationUnitDbId? #39

Closed dlebauer closed 4 years ago

dlebauer commented 4 years ago

I would like to query all data of a particular variable and filter by a particular study

Specifically, this query currently returns an error: https://brapi.workbench.terraref.org/brapi/v1/observationunits?studyDbId=6000000010&observationVariableDbId=6000000196

But I get this:

{
  "detail": "The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.",
  "status": 500,
  "title": "Internal Server Error",
  "type": "about:blank"
}

But I would expect it to return something similar to https://brapi.workbench.terraref.org/brapi/v1/observationunits?observationUnitDbId=MAC Field Scanner Season 4 Range 13 Column 10&observationVariableDbId=6000000196

Suspected problem

It appears that this might be caused by the lines

https://github.com/terraref/brapi/blob/master/api/observationunits.py#L45

image

What was the rationale for this (@max-zilla ?) Perhaps to avoid returning too much data? When we look for a particular variable, this is less of an issue.