Skip to content

RenameFlowRunTask: use default flow_run_id value from context#3548

Merged
jcrist merged 10 commits into
PrefectHQ:masterfrom
sp1thas:default_flow_run_id_for_renameflowruntask
Oct 20, 2020
Merged

RenameFlowRunTask: use default flow_run_id value from context#3548
jcrist merged 10 commits into
PrefectHQ:masterfrom
sp1thas:default_flow_run_id_for_renameflowruntask

Conversation

@sp1thas
Copy link
Copy Markdown

@sp1thas sp1thas commented Oct 20, 2020

Summary

Use default flow_run_id value for RenameFlowRunTask from context. More details: #3535

Changes

RenameFlow.run will use flow_run_id from context if is not provided.

Importance

This PR will simplify the usage of RenameFlowRunTask by making flow_run_id parameter optional.

I'm not sure about the added test, take a closer look :)

Checklist

This PR:

  • adds new tests (if appropriate)
  • adds a change file in the changes/ directory (if appropriate)
  • updates docstrings for any new functions or function arguments, including docs/outline.toml for API reference docs (if appropriate)

@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 20, 2020

Codecov Report

Merging #3548 into master will not change coverage.
The diff coverage is n/a.

@zanieb
Copy link
Copy Markdown
Contributor

zanieb commented Oct 20, 2020

Hi! Thanks for picking up this issue. Note that the RenameFlowRunTask name was deprecated and replaced with RenameFlowRun in #3539 so you'll have to fix that conflict

Comment thread src/prefect/tasks/prefect/flow_run_rename.py Outdated
Comment thread tests/tasks/prefect/test_flow_run_rename.py Outdated
Comment thread tests/tasks/prefect/test_flow_run_rename.py Outdated
@zanieb zanieb linked an issue Oct 20, 2020 that may be closed by this pull request
sp1thas and others added 7 commits October 20, 2020 16:55
# Conflicts:
#	tests/tasks/prefect/test_flow_run_rename.py
Co-authored-by: Michael Adkins <madkinszane@gmail.com>
Co-authored-by: Michael Adkins <madkinszane@gmail.com>
…m:sp1thas/prefect into default_flow_run_id_for_renameflowruntask
Copy link
Copy Markdown
Contributor

@zanieb zanieb left a comment

Choose a reason for hiding this comment

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

Looks good!

"""
Args:
- flow_run_id (str, optional): The ID of the flow run to rename
- flow_run_id (str, optional): The ID of the flow run to rename. If `None`,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Technically an empty string will trigger a context lookup too

Suggested change
- flow_run_id (str, optional): The ID of the flow run to rename. If `None`,
- flow_run_id (str, optional): The ID of the flow run to rename. If empty,

@jcrist jcrist merged commit b28e2e8 into PrefectHQ:master Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RenameFlowRunTask should use a sensible default

3 participants