-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[CORE-20] [Bug] Jobs running on dbt 1.0.0 are failing when setup to defer to a pre 1.0.0 manifest #4470
Comments
This is a tricky chicken-and-egg problem. Artifacts are versioned, such that we should be able to compare artifact version and raise a helpful error message: dbt-core/core/dbt/exceptions.py Lines 271 to 296 in 3fc715f
That error message is supposed to be raised in the dbt-core/core/dbt/contracts/state.py Lines 16 to 20 in 3fc715f
Unfortunately, we raise a different error here: ipdb> self.manifest = WritableManifest.read(str(manifest_path))
*** mashumaro.exceptions.MissingField: Field "metrics" of type Mapping[str, ParsedMetric] is missing in WritableManifest instance Is there any way we can trip the It would definitely be preferable to raise a different error message, one that more clearly indicates the cause of the problem is a version mismatch. The job would still fail, though. In this particular case, there are things that dbt Cloud could do here to help, such as including dbt version in the deferral candidate logic: the run must be successful and using the same dbt version as the current job definition. That's even more feasible, post-v1, since dbt Cloud will consider all versions There's a desirable future world in which such logic would be too strict, because artifact schema versions aren't changing with each new minor version of |
* [#4470] Improve checking of schema version for pre-1.0.0 manifests * Check exception code instead of message in test
I see a PR is now open! Thank you @gshank and team. Does this update make it so that I can run
without an error? Or will I still receive an error, but a more descriptive and clear one than I am upgrading from 0.21.1 to 1.0.0. Thank you! [Update: I ended up modifying my job to avoid the state comparison for the purpose of this upgrade, per this Slack thread.] |
Avoiding the state comparison is the right way to go. We can't load a pre-1.0.0 manifest because several of the field definitions have changed, so the "fix" is to give a better error message. Glad that you were able to get around it! |
Is there an existing issue for this?
Current Behavior
When a job with
defer
set is updated from a pre 1.0.0 version of dbt-core to 1.0.0, the job fails with the following error:Field "metrics" of type Mapping[str, ParsedMetric] is missing in WritableManifest instance
-Expected Behavior
Jobs with
defer
set should be able to be updated to dbt-core 1.0.0 without error.Steps To Reproduce
Relevant log output
`Field "metrics" of type Mapping[str, ParsedMetric] is missing in WritableManifest instance`-
Environment
What database are you using dbt with?
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: