Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dbt): suppress experimental warning when invoking
@dbt_assets
(d…
…agster-io#22528) ## Summary & Motivation When using `@dbt_assets`, I get a bunch of errors like: ``` 2024-06-13 11:06:20 -0400 - dagster - WARNING - /Users/rexledesma/dagster-labs/dagster/python_modules/dagster/dagster/_core/decorator_utils.py:203: ExperimentalWarning: Parameter `tags` of initializer `AssetOut.__init__` is experimental. It may break in future versions, even between dot releases. To mute warnings for experimental functionality, invoke warnings.filterwarnings("ignore", category=dagster.ExperimentalWarning) or use one of the other methods described at https://docs.python.org/3/library/warnings.html#describing-warning-filters. return fn(*args, **kwargs) 2024-06-13 11:06:20 -0400 - dagster - WARNING - /Users/rexledesma/dagster-labs/dagster/python_modules/dagster/dagster/_core/decorator_utils.py:203: ExperimentalWarning: Parameter `tags` of initializer `AssetOut.__init__` is experimental. It may break in future versions, even between dot releases. To mute warnings for experimental functionality, invoke warnings.filterwarnings("ignore", category=dagster.ExperimentalWarning) or use one of the other methods described at https://docs.python.org/3/library/warnings.html#describing-warning-filters. return fn(*args, **kwargs) 2024-06-13 11:06:20 -0400 - dagster - WARNING - /Users/rexledesma/dagster-labs/dagster/python_modules/dagster/dagster/_core/decorator_utils.py:203: ExperimentalWarning: Parameter `tags` of initializer `AssetOut.__init__` is experimental. It may break in future versions, even between dot releases. To mute warnings for experimental functionality, invoke warnings.filterwarnings("ignore", category=dagster.ExperimentalWarning) or use one of the other methods described at https://docs.python.org/3/library/warnings.html#describing-warning-filters. return fn(*args, **kwargs) ``` This does not inspire confidence when I am using these APIs. My thought process on this is: 1. If we use experimental APIs on behalf of the user in the default case, they should not be shown. 2. Experimental warnings should only be shown once per call site, not once per invocation. 3. If an entrypoint for an integration is experimental (e.g. `DbtProject`), an experimental warning should be shown once, at instantiation of the experimental entrypoint. If the entrypoint itself is implemented using experimental APIs, those subsequent warnings should be suppressed (i.e. we should follow (1)). In this PR, we follow (1) for `@dbt_assets`. ## How I Tested These Changes pytest
- Loading branch information