Emir Karamehmetoglu
02/29/2024, 3:50 PMpackage:
__init__.py
definitions.py # contains definitions
module:
__init__.py
code.py
Where should I silence the warnings?Scout
02/29/2024, 3:50 PMwarnings
module to filter out the warnings. Since you want to apply this globally, you should place the warning filter at the entry point of your application, which is typically where your Dagster repository or pipelines are defined.
Based on the structure of your codebase, it seems like definitions.py
might be the file where you define your Dagster assets or pipelines. You can add the warning filter at the top of this file, before any other imports or code execution that might trigger the warnings.
Here's how you can do it:
python
import warnings
from dagster import ExperimentalWarning
warnings.filterwarnings("ignore", category=ExperimentalWarning)
By placing this code at the top of definitions.py
, you ensure that the experimental warnings are ignored for the entire codebase when it is executed. This way, you don't need to repeat the warning filter in every file.
Remember that silencing warnings should be done with caution, as it will suppress all experimental warnings, which are intended to inform you about features that may change in the future. Make sure you are willing to accept the risk of future changes to the experimental features you are using. How to silence the ExperimentalWarning? button Silence experimental warnings underneath... button experimental warnings for asset checks button experimental warning for group-based dep... button Thank you for your feedback!