USEPA / ccdR

Predecessor to ctxR. Utilities for Interacting with the CTX APIs in R without prior API knowledge. All data is also available on the CompTox Chemical Dashboard (CCD) https://comptox.epa.gov/dashboard/
https://github.com/USEPA/ctxR
GNU General Public License v3.0
2 stars 0 forks source link

get_bioactivity_details(m4id) results in error if m4id is not found #50

Closed cthunes closed 5 months ago

cthunes commented 5 months ago

When retrieving details by AEID, SPID, or DTXSID an empty (null) data table is returned if no data is found for the given ID. If no data is found for a given m4id, instead this error is thrown on line #79 (jsonlite::fromJSON):

Error: parse error: premature EOF

                     (right here) ------^

As a result, this is affecting the related _batch function by filling any missing m4ids in the list with NA.

rachmaninoffpk commented 5 months ago

The API returns "[ ]" as the content for AEID, SPID, DTXSID when the request does not match data available, however, for m4id it returns "" as the content when a 200 response is given.