Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dbt): suppress experimental warning when invoking @dbt_assets #22528

Merged
merged 1 commit into from
Jun 14, 2024

Conversation

rexledesma
Copy link
Contributor

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

Copy link

vercel bot commented Jun 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
dagster-website ❌ Failed (Inspect) Jun 13, 2024 3:20pm

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @rexledesma and the rest of your teammates on Graphite Graphite

@rexledesma rexledesma force-pushed the rl/suppress-experimental-warnings-on-dbt-assets branch from e030e7b to 637f1c1 Compare June 14, 2024 16:18
@rexledesma rexledesma merged commit 8dcec5d into master Jun 14, 2024
1 check was pending
@rexledesma rexledesma deleted the rl/suppress-experimental-warnings-on-dbt-assets branch June 14, 2024 16:21
danielgafni pushed a commit to danielgafni/dagster that referenced this pull request Jun 18, 2024
…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
@brandonpeebles
Copy link
Contributor

For the DagsterDbtManifestPreparer warning specifically, should we be seeing this error just once or not at all? We're on dagster==1.7.12 but I'm still noticing that warning in particular and can't quite figure out what it is.

ExperimentalWarning: Class `DagsterDbtManifestPreparer` 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.
  manifest_preparer: DbtManifestPreparer = DagsterDbtManifestPreparer(),

@rexledesma
Copy link
Contributor Author

@brandonpeebles DagsterDbtManifestPreparer is non-experimental starting dagster==1.7.13 and dagster-dbt==0.23.13: #22578. So I would suggest that you just upgrade to remove these warnings.

@brandonpeebles
Copy link
Contributor

@rexledesma gotcha, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants