Fix prefect deploy
with dynamic @flow decorator args
#13967
Merged
+96
−4
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.
Closes #13895 and #13950.
#13315 helped solve #9512 but in doing so introduced some regressions when using non-str type values for
@flow
arguments like name/description.The key difference from changes introduced there is that we parse the flow name/description using an AST and as-is, args are expected to be raw
str
values and variables/expressions don't get evaluated correctly. This PR changes this by attempting toeval()
when the value is not a constant.If an arg is using a dependency that's not available in the current environment, then a message is logged to the user and the decorator arg is skipped, falling back to default behavior as if one was not supplied at all.
Note
Resolving relative imports for use here within the
@flow
decorator remains a bit tricky and should constitute a separate issue should that functionality be needed.Checklist
<link to issue>
"maintenance
,fix
,feature
,enhancement
,docs
.For documentation changes:
mint.json
for files that are removed or renamed.For new functions or classes in the Python SDK:
docs/mint.json
navigation.