VEuPathDB/EdaDataService

donut/bar map-markers returning 500 Requested data stream 'single_tabular_dataset' did not contain any data.

Closed this issue · 5 comments

When filters remove all data for the chosen overlay/marker variable, there is an error.

I think it would be fine to receive an empty array of mapElements?

ESC[mESC[33m2023-08-24 16:50:04.263 [rid:     ] WARN  ErrorMapper:70 - Caught Exception: 
ESC[m org.veupathdb.service.eda.common.client.NonEmptyResultStream$EmptyResultException: Requested data stream 'single_tabular_d
ataset' did not contain any data.
        at org.veupathdb.service.eda.common.client.NonEmptyResultStream.throwException(NonEmptyResultStream.java:56) ~[service.j
ar:3.0.0]
        at org.veupathdb.service.eda.common.client.NonEmptyResultStream.read(NonEmptyResultStream.java:47) ~[service.jar:3.0.0]
        at java.io.BufferedInputStream.read1(BufferedInputStream.java:282) ~[?:?]
        at java.io.BufferedInputStream.read(BufferedInputStream.java:343) ~[?:?]

Back end: qa.vectorbase.org
Study: Mega test 1
Filters: Insecticide resistance assay -> insecticide = DDT
Marker: bubble or chart
Marker variable: blood meal host organism

POST data

{"studyId":"VBP_MEGA","filters":[{"variableId":"APOLLO_SV_00000445","entityId":"OBI_0002695","type":"numberRange","min":0,"max":102.06}],"config":{"geoAggregateVariable":{"entityId":"GAZ_00000448","variableId":"EUPATH_0043203"},"latitudeVariable":{"entityId":"GAZ_00000448","variableId":"OBI_0001620"},"longitudeVariable":{"entityId":"GAZ_00000448","variableId":"OBI_0001621"},"overlayConfig":{"overlayType":"categorical","overlayVariable":{"variableId":"OBI_0002995","entityId":"OBI_0002732"},"overlayValues":[]},"outputEntityId":"OBI_0002732","valueSpec":"count","viewport":{"latitude":{"xMin":-90,"xMax":90},"longitude":{"left":-180,"right":180}}}}

How to reproduce with SCORE S. mansoni CRT:

  1. open map
  2. filter on School-age children treated in village count
  3. put logscale y axis on (so you can see small values clearly)
  4. filter in an empty part of the plot (see below)
  5. close filter to see evidence of 500 error

image

Now easy to reproduce by selecting an empty region on the ez time slider.

Looks like this check was added by design in the past. It might be good to check with @ryanrdoherty if he has context on why we added it originally.

I've tested a local back end without the check that Dan mentioned above. That works for the map (though we need to think about the UX associated with the empty responses - which is hard to play around with using the local back end transatlantically).

I'll start a Slack discussion about where we go next.

It's going to require some coordination with the front-end, but we discussed in scrum returning a 204 (empty response) instead of a 500 in this case.

There might need to be some custom handling of these cases in the client. Ryan made us aware of the reason for the check, which is that the R code does not handle empty subsets well.

Here's the PR with the fix: https://github.com/VEuPathDB/EdaDataService/pull/328/files

Closing this, since #328 has been merged