Skip to content
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

retry function in dbt-core #7020

Closed
wants to merge 2 commits into from
Closed

retry function in dbt-core #7020

wants to merge 2 commits into from

Conversation

ChenyuLInx
Copy link
Contributor

@ChenyuLInx ChenyuLInx commented Feb 21, 2023

This code is garbage, just to demo some ideas RN

implement a retry command that can run your project from an existing state

dbt retry --state target/

TODO

  • this command should probably not parse any project file, it should just read the manifest in that state

Previous run
Screenshot 2023-02-20 at 10 44 35 PM

running retry
Screenshot 2023-02-20 at 10 43 31 PM

@cla-bot cla-bot bot added the cla:yes label Feb 21, 2023
@ChenyuLInx ChenyuLInx requested a review from jtcohen6 February 21, 2023 06:37
@github-actions
Copy link
Contributor

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.

Copy link
Contributor

@jtcohen6 jtcohen6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very cool proof of concept :)

this command should probably not parse any project file, it should just read the manifest in that state

Yes, we need to do this to enable "manifest-only" execution! Related to many of the conversations we've been having. Where/how should we persist runtime config? In the manifest? As contents of raw dbt_project.yml file, or resolved Project object?

ctx.obj["manifest"],
)

from dbt import selected_resources
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to de-globalize this (ik yk): #6009

task.compile_manifest()
selected_resources.set_selected_resources(set(unique_ids))
new_graph = task.graph.get_subset_graph(set(unique_ids))
# should we give a way here for consumers to mutate the graph?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe? Mutate the graph in the sense of:

if result.status not in [RunStatus.Success, TestStatus.Pass]
]
# Using build task since it has a more complete runner set now
task = BuildTask(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I right in thinking - we'd need a way to dynamically load the appropriate task, based on previous_state.results.args.which?

@jtcohen6
Copy link
Contributor

Closing for now, in favor of the new issue:

@jtcohen6 jtcohen6 closed this Apr 12, 2023
@ChenyuLInx ChenyuLInx deleted the cl/dbt-retry branch May 2, 2024 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants