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

[Feature] An option to silence warnings #9644

Closed
3 tasks done
jtcohen6 opened this issue Feb 23, 2024 · 4 comments · Fixed by #10058
Closed
3 tasks done

[Feature] An option to silence warnings #9644

jtcohen6 opened this issue Feb 23, 2024 · 4 comments · Fixed by #10058
Assignees
Labels
enhancement New feature or request user docs [docs.getdbt.com] Needs better documentation
Milestone

Comments

@jtcohen6
Copy link
Contributor

jtcohen6 commented Feb 23, 2024

Is this your first time submitting a feature request?

  • I have read the expectations for open source contributors
  • I have searched the existing issues, and I could not find an existing issue for this feature
  • I am requesting a straightforward extension of existing dbt functionality, rather than a Big Idea better suited to a discussion

Describe the feature

https://docs.getdbt.com/reference/global-configs/warnings

warn_error_options:
  error: # previously called "include", promote to "error"
  warn: # previously called "exclude", keep as "warn"
  silence: # NEW: ignore entirely

(We'd retain the old names as well for backwards compatability)

Screenshot 2024-02-23 at 10 56 05

Describe alternatives you've considered

  • A separate config, WARN_SILENCE, that takes a list. This would be better in the case where a user wants to silence warnings via project flags (version-controlled default for everyone), and also promote specific warnings as errors (via include/exclude) in different runtime environments, without needing to re-specify the silence list every time. While that's slightly more ergonomic, it's also less explicit, and it doesn't feel like a show-stopper.
  • Only allow users to silence deprecation warnings. I think there's a valid reason to generalize this to all kinds of warnings, e.g. silence ConstraintNotEnforced once for the entire project rather than once per model/constraint in the project.
  • Remove TestsConfigDeprecation (= give up in advance)

Who will this benefit?

All users of dbt, especially since:

  • In v1.8, we are renaming tests → to data_tests, for clearer distinction from unit_tests. Tens of thousands of projects will experience the TestsConfigDeprecation. They won't all be able to take action. We should give them a way to silence the deprecation (for now).
  • We should still reword that deprecation message! Wording of TestConfigDeprecation is incorrect #9579

Are you interested in contributing this feature?

:)

Anything else?

Sketched out a start:

Example:

$ cat dbt_project.yml
name: "my_dbt_project"

tests:
  +enabled: True

flags:
  warn_error_options:
    silence:
      - TestsConfigDeprecation
$ dbt --no-partial-parse parse
16:02:55  Running with dbt=1.8.0-a1
16:02:56  Registered adapter: duckdb=1.7.0
16:02:57  Performance info: /Users/jerco/dev/scratch/testy/target/perf_info.json

Slack thread with more context

@jtcohen6 jtcohen6 added the enhancement New feature or request label Feb 23, 2024
@jtcohen6 jtcohen6 added this to the v1.8 milestone Feb 23, 2024
@graciegoheen graciegoheen added the user docs [docs.getdbt.com] Needs better documentation label Feb 27, 2024
@MichelleArk
Copy link
Contributor

From technical refinment:

@martynydbt
Copy link

@QMalcolm I removed the blocker since you're unblocked.

@FishtownBuildBot
Copy link
Collaborator

Opened a new issue in dbt-labs/docs.getdbt.com: dbt-labs/docs.getdbt.com#5417

@mirnawong1
Copy link
Contributor

we've opened a docs PR dbt-labs/docs.getdbt.com#5434 and sharing the preview

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request user docs [docs.getdbt.com] Needs better documentation
Projects
None yet
7 participants