Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note: Holding off on tests and documentation until discussion
Summary
I'd like to improve the flow development experience in a project format which benefits from some additional utilities.
This introduces a
flow_builder
decorator for functions that will initialize a flow named after the wrapped function and enter the context.Tasks called from within the function are added to the flow
Flow initializer arguments can be passed
It also introduces a
run_or_register
utility which takes the place ofwhere users frequently have to comment out one of the calls. This allows you to do
then
python my-flow-file.py <run/register>
to run or register it.It also supports callables that produce flows so flows can be functional e.g.
The
flow_builder
decorator calls this automatically so it doesn't need to be included in every file and args can be passed to it still, e.g.Flow builder functions can be imported and treated normally as well, this doesn't make use of
run/register_kwargs
though -- it may be nice to have these defaults be stored in theFlow
object?Changes
flows
utilitiesImportance
__main__
usageChecklist
This PR:
changes/
directory (if appropriate)docs/outline.toml
for API reference docs (if appropriate)