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] UnpinnedRefNewVersionAvailable messages cannot be silenced #11221

Open
2 tasks done
nicholasyager opened this issue Jan 17, 2025 · 0 comments
Open
2 tasks done

[Bug] UnpinnedRefNewVersionAvailable messages cannot be silenced #11221

nicholasyager opened this issue Jan 17, 2025 · 0 comments
Labels
bug Something isn't working triage

Comments

@nicholasyager
Copy link
Contributor

nicholasyager commented Jan 17, 2025

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

When leveraging pre-releases for dbt model versioning, dbt-core helpfully prints a message during compilation when a message contains a reference to an unpinned upstream model if that upstream model has a pre-release version. While useful on a small scale, these messages can quickly become noisy if there are multiple models with pre-release versions. Unfortunately, these messages cannot be silenced, which means there is no way to prevent the logging of these messages (a couple of hundred messages in the case of one of my employer's dbt projects).

Expected Behavior

As a dbt-core user, I would expect that I would be able to silence UnpinnedRefNewVersionAvailable messages using the documented warning and error silencing process1. As such, I should be able to add the following flag to my dbt_project.yml to silence these messages entirely:

flags:
  warn_error_options:
    silence:
      - UnpinnedRefNewVersionAvailable

Steps To Reproduce

  1. Install dbt-core
  2. Setup a dbt project
  3. Create a versioned dbt model, such that there exists both a latest version of the model and a pre-release version of the model
  4. Build the project and observe the presence of an unpinned reference message
  5. Add UnpinnedRefNewVersionAvailable to the warn_error_options flags config.
  6. Build the project and observe the continued presence of an unpinned reference message

Relevant log output

$ dbt --warn-error-options '{"silence": ["UnpinnedRefNewVersionAvailable"]}' compile --select [REDACTED]

14:26:31  Running with dbt=1.8.9
14:26:32  Registered adapter: snowflake=1.8.4
14:26:44  Found 5560 models, 149 snapshots, 1 analysis, 8632 data tests, 308 seeds, 1 operation, 1859 sources, 15 exposures, 1221 macros, 12 groups, 4 unit tests
14:26:44  
14:26:51  Concurrency: 8 threads (target='dev')
14:26:51  
14:26:51  While compiling '[MODEL]':
Found an unpinned reference to versioned model '[UPSTREAM_MODEL]' in project '[PROJECT]'.
Resolving to latest version: [UPSTREAM_MODEL].v1
A prerelease version 2 is available. It has not yet been marked 'latest' by its maintainer.
When that happens, this reference will resolve to [UPSTREAM_MODEL].v2 instead.

  Try out v2: {{ ref('[PROJECT]', '[UPSTREAM_MODEL]', v='2') }}
  Pin to  v1: {{ ref('[PROJECT]', '[UPSTREAM_MODEL]', v='1') }}

Compiled node '[MODEL]' is:

[REDACTED]

Environment

- OS: MacOS 14.7
- Python: 3.11.5
- dbt: 1.8.9

Which database adapter are you using with dbt?

snowflake

Additional Context

I suspect the cause of the issue is that UnpinnedRefNewVersionAvailable inherits from InfoLevel and not WarnLevel2. If this is the case, it should be relatively easy to resolve this issue.

Footnotes

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

  2. https://github.com/dbt-labs/dbt-core/blob/3de3b827bfffdc43845780f484d4d53011f20a37/core/dbt/events/types.py#L832

@nicholasyager nicholasyager added bug Something isn't working triage labels Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

1 participant