-
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
Er/3899 models key mismatch #3959
Conversation
a68b5d7
to
26a30a4
Compare
26a30a4
to
8ee43df
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work pulling on the thread for this one. I left a few small comments
8ee43df
to
7b16b88
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Feels really close
core/dbt/contracts/graph/manifest.py
Outdated
self._disabled[node.unique_id].append(node) | ||
else: | ||
self._disabled[node.unique_id] = [node] | ||
self.disabled.append(node) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's changed here? Are we no longer patching properties for disabled nodes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we've ever patched disabled nodes. That's the way that it worked when I first saw it anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that feels right though. I woud have no objection to patching disabled nodes. They do come out in the manifest.json.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But a lookup won't find them (since they're not included there), so we'd have to separately look them up in disabled.
@@ -567,7 +567,6 @@ class Manifest(MacroMethods, DataClassMessagePackMixin, dbtClassMixin): | |||
# Moved from the ParseResult object | |||
source_patches: MutableMapping[SourceKey, SourcePatch] = field(default_factory=dict) | |||
# following is from ParseResult | |||
_disabled: MutableMapping[str, List[CompileResultNode]] = field(default_factory=dict) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should remove the list form of disabled, and switch to a dictionary (MutableMapping) form. (I'm not sure why this one says [str, List..]. I don't see why it would ever be an actual list, there should only be one node per unique_id). That's more in keeping with the other stored nodes ('nodes', 'macros', etc). That would involve remove the current 'disabled' from the Manifest, and renaming '_disabled' to 'disabled'. (And fixing the definition.) So in the places where a node is added to the disabled list, you'd need to add it to the dictionary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jtcohen6 Disabled does show up in manifest.json, so this would be a manifest schema change. Do you agree with what I propose here? If we're going to do it, for 1.0 is the right time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your proposal makes sense to me! We should feel well within our rights to make these kind of schema changes ahead of 1.0
core/dbt/contracts/graph/manifest.py
Outdated
self._disabled[node.unique_id].append(node) | ||
else: | ||
self._disabled[node.unique_id] = [node] | ||
self.disabled.append(node) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we've ever patched disabled nodes. That's the way that it worked when I first saw it anyway.
… overlooked arg order
4f5006f
to
332d23c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
resolves # 3899
Description
Give a warning when a node is specified under the wrong type in
schema.yml
and don't continue processing.Does this still need to be handled - I couldn't produce the behavior: Throw an exception for any model/seed/snapshot that has a
unique_id
ofNone
and is not disabled.As part of this change
manifest._disabled
was also removed in favor of the existingmanifest.disabled
.Checklist
CHANGELOG.md
and added information about my change to the "dbt next" section.