-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[CT-3071] [Bug] failed to resolve schema version #8544
Comments
@qrtt1 Thanks for opening! This is definitely a bug, and one we should resolve quickly, since it will affect anyone who's upgrading to v1.6. This is a naive fix: import re
...
def get_manifest_schema_version(dct: dict) -> int:
schema_version = dct.get("metadata", {}).get("dbt_schema_version", None)
if not schema_version:
raise ValueError("Manifest doesn't have schema version")
match_str = "v([0-9]+)"
return int(re.search(match_str, schema_version).groups()[0]) >>> schema_version = "https://schemas.getdbt.com/dbt/manifest/v10.json"
>>> match_str = "v([0-9]+)"
>>> int(re.search(match_str, schema_version).groups()[0])
10 We should also figure out why this errant behavior wasn't being caught in our test for manifest version upgrades / backward compatibility: https://github.com/dbt-labs/dbt-core/blob/main/tests/functional/artifacts/test_previous_version_state.py |
I'm able to replicate this issue and updated the test case to fail: #8551. I'll now work on updating the code to make the test case pass. |
Is this a new bug in dbt-core?
Current Behavior
The latest
get_manifest_schema_version
will get wrong versions and drop the metrics data:https://github.com/dbt-labs/dbt-core/blob/v1.6.1/core/dbt/contracts/graph/manifest.py
This input will get
0
And it will make scheam upgrader to drop metrics data
https://github.com/dbt-labs/dbt-core/blob/v1.6.1/core/dbt/contracts/graph/manifest_upgrade.py#L65-L69
Expected Behavior
The
metrics
data should be keptSteps To Reproduce
dbt parse --target-path baseline
dbt list -s 'state:modified' --state baseline
Relevant log output
No response
Environment
The text was updated successfully, but these errors were encountered: