@@ -374,10 +374,6 @@ def test_missions_filter_products(patch_post):
374374 filtered = mast .MastMissions .filter_products (products , extension = 'fits' )
375375 assert len (filtered ) > 0
376376
377- # Filter by non-existing column
378- with pytest .warns (InputWarning ):
379- mast .MastMissions .filter_products (products , invalid = True )
380-
381377 # Numeric filtering
382378 # Single integer value
383379 filtered = mast .MastMissions .filter_products (products , size = 11520 )
@@ -412,6 +408,10 @@ def test_missions_filter_products(patch_post):
412408 # Invalid filter value
413409 mast .MastMissions .filter_products (products , size = 'invalid' )
414410
411+ # Error when filtering by non-existing column
412+ with pytest .raises (InvalidQueryError , match = "Column 'non_existing' not found in product table." ):
413+ mast .MastMissions .filter_products (products , non_existing = 'value' )
414+
415415
416416def test_missions_download_products (patch_post , tmp_path ):
417417 # Check string input
@@ -720,10 +720,6 @@ def test_observations_filter_products(patch_post):
720720 filtered = mast .Observations .filter_products (products , extension = 'fits' )
721721 assert len (filtered ) > 0
722722
723- # Filter by non-existing column
724- with pytest .warns (InputWarning ):
725- mast .Observations .filter_products (products , invalid = True )
726-
727723 # Numeric filtering
728724 filtered = mast .Observations .filter_products (products , size = '<50000' )
729725 assert all (filtered ['size' ] < 50000 )
@@ -732,6 +728,10 @@ def test_observations_filter_products(patch_post):
732728 with pytest .raises (InvalidQueryError , match = "Could not parse numeric filter 'invalid' for column 'size'" ):
733729 filtered = mast .Observations .filter_products (products , size = 'invalid' )
734730
731+ # Filter by non-existing column
732+ with pytest .raises (InvalidQueryError , match = "Column 'invalid' not found in product table." ):
733+ mast .Observations .filter_products (products , invalid = True )
734+
735735
736736def test_observations_download_products (patch_post , tmpdir ):
737737 # actually download the products
0 commit comments