Skip to content

Commit 8967fe2

Browse files
author
C. E. Brasseur
authored
Merge pull request #1921 from nataliekorzh/empty-obs
Added case for catching empty observations product requests
2 parents 2ec47b7 + 0e4cb5b commit 8967fe2

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

CHANGES.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ mast
4141
``Core.get_token()``, ``Core.enable_s3_hst_dataset()``, ``Core.disable_s3_hst_dataset()`` and
4242
variables obstype and silent [#1884]
4343
- Added Zcut functionality to astroquery [#1911]
44+
- Fixed error causing empty products passed to ``Observations.get_product_list()`` to yeild a
45+
non-empty result. [#1921]
4446

4547
esa/hubble
4648
^^^^^^^^^^

astroquery/mast/observations.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,8 @@ def get_product_list_async(self, observations):
427427
-------
428428
response : list of `~requests.Response`
429429
"""
430+
if len(observations) == 0 or not observations["obsid"]:
431+
raise InvalidQueryError("Observation list is empty, no associated products.")
430432

431433
# getting the obsid list
432434
if isinstance(observations, Row):

0 commit comments

Comments
 (0)