Skip to content

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

@bsipocz

Description

@bsipocz

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


Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions