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

RenameFlowRunTask: use default flow_run_id value from context #3548

Merged

Conversation

sp1thas
Copy link

@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

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
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

@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
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!

@@ -30,24 +31,30 @@ def __init__(
def run(self, flow_run_id: str, flow_run_name: str) -> bool:
"""
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
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