Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: SIA should raise exception for non-existing collection #651

Open
bsipocz opened this issue Feb 13, 2025 · 5 comments
Open

ENH: SIA should raise exception for non-existing collection #651

bsipocz opened this issue Feb 13, 2025 · 5 comments

Comments

@bsipocz
Copy link
Member

bsipocz commented Feb 13, 2025

[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')
<DALResultsTable length=0>
  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]: 
<DALResultsTable length=0>
  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    
------- ------- ------------- --------------- ------------------- ... ------- ------------ ------ -------------


@bsipocz bsipocz added the bug label Feb 13, 2025
@bsipocz
Copy link
Member Author

bsipocz commented Feb 13, 2025

This is actually an upstream issue, as we should get the exception on the pyvo level already.

@bsipocz bsipocz transferred this issue from astropy/astroquery Feb 13, 2025
@bsipocz bsipocz changed the title BUG: IRSA query_sia should raise exception for non-existing collection BUG: SIA should raise exception for non-existing collection Feb 13, 2025
@msdemlei
Copy link
Contributor

msdemlei commented Feb 17, 2025 via email

@bsipocz
Copy link
Member Author

bsipocz commented Feb 18, 2025

Thank you Markus. Yes, I got to the same conclusion that this would be very hard even if possible on the pyvo level. I know that e.g. at IRSA we have a metadata query response for the special case of maxrec=0, but that's not universal behaviour from the services, and we cannot even handle the IRSA case (#519).

So I may just reopen this issue in astroquery where I could do the sanity check for the collection parameter using a cached list of possible collection names.

@bsipocz bsipocz changed the title BUG: SIA should raise exception for non-existing collection ENH: SIA should raise exception for non-existing collection Feb 18, 2025
@msdemlei
Copy link
Contributor

msdemlei commented Feb 18, 2025 via email

@bsipocz
Copy link
Member Author

bsipocz commented Feb 18, 2025

An interoperable solution would be indeed best!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants