astropy / astropy/pyvo

ENH: SIA should raise exception for non-existing collection

Open
#651 7 comments 0 reactions 0 assignees View on GitHub
bug component: SIA
Dominant language
Python
Stars
88
Forks
64
Avg merge
38m
Merged PRs (30d)
1

Description

[Edit:] This has started as an astroquery issue, but looking more into it, the exception should be raised already on the pyvo level, so I transferred the issue.

```
>>> import pyvo as vo
>>> sia2 = vo.dal.sia2.SIA2Service('https://irsa.ipac.caltech.edu/SIA')
>>> sia2.search((0,0,10), collection='foobar')

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
------- ------- ------------- --------------- ------------------- ... ------- ------------ ------ -------------
```

============

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
------- ------- ------------- --------------- ------------------- ... ------- ------------ ------ -------------

```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with pyvo's SIA2Service.search entry point and compare it with the Irsa.query_sia example in the issue. Determine how a nonexistent collection is represented by the service, then make the completed behavior raise an exception instead of returning an empty result table; add or update coverage if an appropriate existing test location is found.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.