-
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
CT 1644 node cleanup #6427
CT 1644 node cleanup #6427
Conversation
Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide. |
4580704
to
a27f2d2
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.
Other than the one comment, looks good.
if not isinstance(node, (ParsedNode)): | ||
raise InternalException(f"type mismatch, expected ParsedNode but got {type(node)}") | ||
raise InternalException( | ||
f"type mismatch, expected ManifestNode but got {type(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.
This error and the check don't match.
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.
They're actually the same thing. Mypy wouldn't let me use ManifestNode in an isinstance check. I'd rather not use ParsedNode in the message, because I think using the superclasses is more confusing...
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.
Maybe just a comment in the code to that effect then?
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.
In any case, it's really not a user-facing exception. It should only show up when a developer has made a mistake :)
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.
Sure, I just want to avoid spending 5 minutes wondering why these don't match next time I'm in there 😄
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.
The comment "# Can't use ManifestNode here because of parameterized generics" wasn't enough?
# ===================================================================== | ||
# This contains the classes for all of the nodes and node-like objects | ||
# in the manifest. In the "nodes" dictionary of the manifest we find | ||
# all of the objects in the ManifestNode union below. In addition the | ||
# manifest contains "macros", "sources", "metrics", "exposures", "docs", | ||
# and "disabled" dictionaries. | ||
# | ||
# The SeedNode is a ManifestNode, but can't be compiled because it has | ||
# no SQL. | ||
# | ||
# All objects defined in this file should have BaseNode as a parent | ||
# class. | ||
# | ||
# The two objects which do not show up in the DAG are Macro and | ||
# Documentation. | ||
# ===================================================================== |
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.
😍
resolves #6426
Description
This pull request contains a lot of cleanup of the manifest nodes.
Note: core/dbt/contracts/graph/nodes.py has changed so much that I don't recommend trying to read the diff. Reviewers should read the changed file instead.
Checklist
changie new
to create a changelog entry