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

Add an idiom for conditional flow control #2727

Merged
merged 5 commits into from
Jun 8, 2020
Merged

Conversation

jcrist
Copy link

@jcrist jcrist commented Jun 5, 2020

This adds an idiom for conditional flow control to the docs. This covers both case and merge, which (IMO) are the main flow control constructs a Prefect user should need. Note that since this (and a few other idioms) overlapped with the branching idiom, I removed that one in favor of this.

This also adds an optional flow kwarg to merge to make it easier to use with the imperative api.

Fixes #2530.

  • adds new tests (if appropriate)
  • add a changelog entry 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)

Makes it easier to use `merge` when not within a flow context.
This idiom covered some bits about conditional branching, and some bits
about just adding "branches" (parallel tasks) in a flow. The same
material seemed to be covered elsewhere, so I removed it.
Of course I only see typos after I've pushed :/
@jcrist
Copy link
Author

jcrist commented Jun 5, 2020

The test failure appears to be unrelated.

@codecov
Copy link

codecov bot commented Jun 6, 2020

Codecov Report

Merging #2727 into master will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Copy link

@joshmeek joshmeek left a comment

Choose a reason for hiding this comment

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

👍

@jcrist jcrist merged commit 58c390e into PrefectHQ:master Jun 8, 2020
@jcrist jcrist deleted the case-idiom branch June 8, 2020 14:50
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.

Write More Idioms
2 participants