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

flow.py: add ability to modify flow_run_id in flow.run() #3163

Merged
merged 4 commits into from Aug 16, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/prefect/core/flow.py
Expand Up @@ -994,6 +994,11 @@ def _run(
"context", {}
).copy() # copy to avoid modification

# set flow_run_id from args or uuid if flow_run_id is not an argument
flow_run_context.setdefault(
"flow_run_id", kwargs.pop("flow_run_id", str(uuid.uuid4()))
)

# run this flow indefinitely, so long as its schedule has future dates
while True:

Expand All @@ -1002,7 +1007,7 @@ def _run(
flow_run_context.update(
scheduled_start_time=next_run_time,
flow_id=self.name,
flow_run_id=str(uuid.uuid4()),
flow_run_id=flow_run_context["flow_run_id"],
flow_run_name=str(uuid.uuid4()),
)

Expand Down