Skip to content

BUG: unable to search SIA with no constraint but maxrec=0 #519

Open
@bsipocz

Description

@bsipocz

While I was trying to resolve astropy/astroquery#2940, I run into this bug

In [60]: from pyvo.dal import SIA2Service

In [61]: sia = SIA2Service(baseurl='https://irsa.ipac.caltech.edu/SIA')

In [62]: sia.search(maxrec=0)
---------------------------------------------------------------------------
DALQueryError                             Traceback (most recent call last)
Cell In[62], line 1
----> 1 sia.search(maxrec=0)

File ~/munka/devel/worktrees/pyvo/testings/pyvo/dal/sia2.py:226, in SIA2Service.search(self, pos, band, time, pol, field_of_view, spatial_resolution, spectral_resolving_power, exptime, timeres, publisher_did, facility, collection, instrument, data_type, calib_level, target_name, res_format, maxrec, **kwargs)
    201 def search(self, pos=None, *, band=None, time=None, pol=None,
    202            field_of_view=None, spatial_resolution=None,
    203            spectral_resolving_power=None, exptime=None,
    204            timeres=None, publisher_did=None, facility=None, collection=None,
    205            instrument=None, data_type=None, calib_level=None,
    206            target_name=None, res_format=None, maxrec=None, **kwargs):
    207     """
    208     Performs a SIA2 search against a SIA2 service
    209 
   (...)
    213 
    214     """
    215     return SIA2Query(self.query_ep, pos=pos, band=band,
    216                      time=time, pol=pol,
    217                      field_of_view=field_of_view,
    218                      spatial_resolution=spatial_resolution,
    219                      spectral_resolving_power=spectral_resolving_power,
    220                      exptime=exptime, timeres=timeres,
    221                      publisher_did=publisher_did,
    222                      facility=facility, collection=collection,
    223                      instrument=instrument, data_type=data_type,
    224                      calib_level=calib_level, target_name=target_name,
    225                      res_format=res_format, maxrec=maxrec,
--> 226                      session=self._session, **kwargs).execute()

File ~/munka/devel/worktrees/pyvo/testings/pyvo/dal/sia2.py:471, in SIA2Query.execute(self)
    457 def execute(self):
    458     """
    459     submit the query and return the results as a SIA2Results instance
    460 
   (...)
    469        for errors parsing the VOTable response
    470     """
--> 471     return SIA2Results(self.execute_votable(), url=self.queryurl, session=self._session)

File ~/munka/devel/worktrees/pyvo/testings/pyvo/dal/adhoc.py:111, in AdhocServiceResultsMixin.__init__(self, votable, url, session)
    110 def __init__(self, votable, *, url=None, session=None):
--> 111     super().__init__(votable, url=url, session=session)
    113     self._adhocservices = list(
    114         resource for resource in votable.resources
    115         if resource.type == "meta" and resource.utype == "adhoc:service"
    116     )

File ~/munka/devel/worktrees/pyvo/testings/pyvo/dal/query.py:336, in DALResults.__init__(self, votable, url, session)
    334 self._status = self._findstatus(votable)
    335 if self._status[0].lower() not in ("ok", "overflow"):
--> 336     raise DALQueryError(self._status[1], self._status[0], url)
    338 if self._status[0].lower() == "overflow":
    339     warn("Partial result set. Potential causes MAXREC, async storage space, etc.",
    340          category=DALOverflowWarning)

DALQueryError: UsageFault: BAD_REQUEST: At least one constraint (e.g. pos or collection) must be specified unless maxrec=0.

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