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

[Bug] flags.warn_error_options.silence should be settable dbt_project.yml #10160

Open
2 tasks done
jtcohen6 opened this issue May 16, 2024 · 3 comments
Open
2 tasks done
Assignees
Labels
backport 1.8.latest bug Something isn't working

Comments

@jtcohen6
Copy link
Contributor

jtcohen6 commented May 16, 2024

Is this a new bug in dbt-core?

  • I believe this is a new bug in dbt-core
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

Missing silence here:

def convert_config(config_name, config_value):
"""Convert the values from config and original set_from_args to the correct type."""
ret = config_value
if config_name.lower() == "warn_error_options" and type(config_value) == dict:
ret = WarnErrorOptions(
include=config_value.get("include", []),
exclude=config_value.get("exclude", []),
valid_error_names=ALL_EVENT_NAMES,
)
return ret

Expected Behavior

def convert_config(config_name, config_value):
    """Convert the values from config and original set_from_args to the correct type."""
    ret = config_value
    if config_name.lower() == "warn_error_options" and type(config_value) == dict:
        ret = WarnErrorOptions(
            include=config_value.get("include", []),
            exclude=config_value.get("exclude", []),
            valid_error_names=ALL_EVENT_NAMES,
            silence=config_value.get("silence", []),  # this line is missing above
        )
    return ret

Steps To Reproduce

  1. Create a project with a test in it
# dbt_project.yml
flags:
  warn_error_options:
    silence:
      - TestsConfigDeprecation

tests:  # has been renamed to data_tests
  +enabled: true
  1. dbt parse -> still see the deprecation warning ("The tests config has been renamed to data_tests")
  2. Apply the patch shown above -> dbt parse -> no deprecation warning

Relevant log output

No response

Environment

- Python: 3.10.11
- dbt: 1.8.0

Which database adapter are you using with dbt?

No response

Additional Context

No response

@kokorin
Copy link

kokorin commented May 30, 2024

I want to add some reasoning to this issue.
We checking if we can update to DBT 1.8, and we changed our configs from tests to data_tests.

The problem is that we use several DBT packages and those packages still use tests.
And I believe that DBT package developers will not update from tests to data_tests because they want to support compatibility with previous DBT versions.

May be it even makes sense to allow warning suppression based on package name, rather than suppressing globally for the whole project.

@jtcohen6
Copy link
Contributor Author

@kokorin Appreciate that rationale! We have a separate issue for scoping that deprecation warning more narrowly:

@ChenyuLInx
Copy link
Contributor

https://github.com/dbt-labs/dbt-core/pull/10058/files#diff-9a7ad4b74c0941bce1368c1e8e12f0745bf0152b00f92df206375702b46e3a8eR133-R140
There should be an integration test catching this.
This might be because include is being required now.(something we potentially want to change).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 1.8.latest bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants