astropy / astropy/astroquery

BUG: SIA should raise exception for non-existing collection

Open
#3,213 1 comment 0 reactions 0 assignees View on GitHub
bug ipac.irsa
Dominant language
Python
Stars
791
Forks
451
Avg merge
1d 3h
Merged PRs (30d)
4

Description

Currently it's possible to query a collection that doesn't exist on the server and receive an empty result table. I would think a better UX would be to receive an exception in these cases.

E.g. currently this is what I get:

```
In [49]: Irsa.query_sia(pos=(coord, 10), collection='foobar')
Out[49]:

s_ra s_dec facility_name instrument_name dataproduct_subtype ... pol_xel cloud_access o_ucd upload_row_id
deg deg ...
float64 float64 object object object ... int64 object object int64
------- ------- ------------- --------------- ------------------- ... ------- ------------ ------ -------------

```

Note that we have looked into addressing this upstream in pyvo, but unfortunately there is no good solutions for this.
So this issue is for specifically for IRSA where we have the possible collection values, thus we cache it for the instance.

x-ref: https://github.com/astropy/pyvo/issues/651

Contributor guide

Open the contributing guide

Research direction

Start at the Irsa.query_sia entry point and inspect the IRSA handling of collection values, including the proposed instance cache. Use the pyvo issue linked in the report for upstream context. Done means a nonexistent collection raises an exception while valid collections continue to return query results.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.