@@ -304,6 +304,7 @@ def _is_valid_query(self, query: Dict[str, Any]) -> Dict[str, Any] | None:
304304 warnings .warn (
305305 f"Query did not match any datasets: { e } \n \n Searching for close matches..." ,
306306 UserWarning ,
307+ stacklevel = 999 ,
307308 )
308309
309310 if len (subset ) != 0 :
@@ -324,7 +325,8 @@ def _is_valid_query(self, query: Dict[str, Any]) -> Dict[str, Any] | None:
324325 # check if the key is in the catalog
325326 if key not in df .columns :
326327 warnings .warn (
327- f"Key { key } not found in catalog. Did you specify the correct catalog?"
328+ f"Key { key } not found in catalog. Did you specify the correct catalog?" ,
329+ stacklevel = 999 ,
328330 )
329331 continue # skip to the next key
330332
@@ -335,7 +337,8 @@ def _is_valid_query(self, query: Dict[str, Any]) -> Dict[str, Any] | None:
335337 ):
336338 warnings .warn (
337339 f"Experiment ID { value } is not valid. "
338- "Please check the available options using `show_experiment_id_options()`."
340+ "Please check the available options using `show_experiment_id_options()`." ,
341+ stacklevel = 999 ,
339342 )
340343 else :
341344 self .all_catalog_keys [key ] = value
@@ -360,14 +363,16 @@ def _is_valid_query(self, query: Dict[str, Any]) -> Dict[str, Any] | None:
360363 if closest_options is not None :
361364 # probably a typo in the value
362365 warnings .warn (
363- f"\n \n Did you mean one of these options for { key } : { closest_options } ?"
366+ f"\n \n Did you mean one of these options for { key } : { closest_options } ?" ,
367+ stacklevel = 999 ,
364368 )
365369 else :
366370 # no close matches found
367371 warnings .warn (
368372 f"\n \n No close matches found for { key } = { value } . "
369373 "\n Based on your query, the available options for this key are: "
370- f"{ remaining_key_values } ."
374+ f"{ remaining_key_values } ." ,
375+ stacklevel = 999 ,
371376 )
372377 else :
373378 # the value is in the catalog, but no datasets were found
@@ -382,7 +387,8 @@ def _is_valid_query(self, query: Dict[str, Any]) -> Dict[str, Any] | None:
382387 f"\n This is constrained by the earlier key { last_key } = { self .all_catalog_keys [last_key ]} . "
383388 f"\n Please check your query and try again. "
384389 f"\n \n To explore available options, "
385- f"\n please use the `show_*_options()` methods."
390+ f"\n please use the `show_*_options()` methods." ,
391+ stacklevel = 999 ,
386392 )
387393 break
388394 # else:
@@ -439,13 +445,15 @@ def _has_valid_processes(self, query: Dict[str, Any]) -> bool:
439445 if not valid_value_for_processor :
440446 warnings .warn (
441447 f"\n \n Processor { key } with value { value } is not valid. "
442- "\n Please check the processor documentation for valid options."
448+ "\n Please check the processor documentation for valid options." ,
449+ stacklevel = 999 ,
443450 )
444451 return False
445452 else :
446453 warnings .warn (
447454 f"\n \n Processor { key } is not registered. "
448- "\n This processor input has not been validated."
455+ "\n This processor input has not been validated." ,
456+ stacklevel = 999 ,
449457 )
450458
451459 return True
0 commit comments