-
Notifications
You must be signed in to change notification settings - Fork 124
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
Add default source nodes rendering #661
base: main
Are you sure you want to change the base?
Conversation
👷 Deploy Preview for amazing-pothos-a3bca0 processing.
|
task_full_name = node.unique_id[len("source.") :] | ||
task_id = f"{task_full_name}_source" | ||
args["select"] = f"source:{node.unique_id[len('source.'):]}" | ||
args["models"] = None |
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.
@tatiana I have a feeling that this lines can be written somewhere else.
My dbt testing showed that
dbt source freshness --models [any]
fails, while using the --select works. I ended up manually setting as None the models argument.
Any thoughts?
if node.has_freshness is False: | ||
return TaskMetadata( | ||
id=task_id, | ||
# arguments=args, |
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.
@tatiana Returning an EmptyOperator just seemed "grayish" in the dag UI. Looking at all the cool cosmos-related operators "DbtLocal..." "Dbt...", etc and having an EmptyOperator didn't seemed to go with the "cosmos pattern", Should we create a dummySourceOperator that inherits EmptyOperator just for the sake of having all Operators follow the same naming pattern?
@@ -742,3 +742,15 @@ def __init__(self, **kwargs: str) -> None: | |||
raise DeprecationWarning( | |||
"The DbtDepsOperator has been deprecated. " "Please use the `install_deps` flag in dbt_args instead." | |||
) | |||
|
|||
|
|||
class DbtSourceLocalOperator(DbtLocalBaseOperator): |
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.
Description
I'm aiming to give a default behaviour to source nodes for checking their source freshness and their tests.
One of the main limitations I found while using the custom_callback functions on source nodes to check freshness is that those node were being created to 100% of sources but not all of them required freshness checks, this made workers waste compute time.
I'm adding a new variable into the DbtNode class called
has_freshness
which would be True for sources with freshness checks and False for the ones that not and any other resource type.All sources with the
has_freshness
== False will be rendered as Empty Operators, to keep the dbt's behavior of showing sources as suggested in issue #630.Related Issue(s)
#630
Breaking Change?
Checklist