You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Create a versioned dbt model, such that there exists both a latest version of the model and a pre-release version of the model
Build the project and observe the presence of an unpinned reference message
Add UnpinnedRefNewVersionAvailable to the warn_error_options flags config.
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.
Is this a new bug in dbt-core?
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 mydbt_project.yml
to silence these messages entirely:Steps To Reproduce
UnpinnedRefNewVersionAvailable
to thewarn_error_options
flags config.Relevant log output
Environment
Which database adapter are you using with dbt?
snowflake
Additional Context
I suspect the cause of the issue is that
UnpinnedRefNewVersionAvailable
inherits fromInfoLevel
and notWarnLevel
2. If this is the case, it should be relatively easy to resolve this issue.Footnotes
https://docs.getdbt.com/reference/global-configs/warnings ↩
https://github.com/dbt-labs/dbt-core/blob/3de3b827bfffdc43845780f484d4d53011f20a37/core/dbt/events/types.py#L832 ↩
The text was updated successfully, but these errors were encountered: