prefect.utilities.templating
determine_placeholder_type
name
: The name of the placeholderfind_placeholders
template
: template to discover placeholders inapply_values
values
, NotSet will
be returned to signify that no placeholder replacement occurred. If
template
is a dictionary that contains a key with a value of NotSet,
the key will be removed in the return value unless remove_notset
is set to False.
Args:
template
: template to discover and replace values invalues
: The values to apply to placeholders in the templateremove_notset
: If True, remove keys with an unset valuewarn_on_notset
: If True, warn when a placeholder is not found in values
resolve_block_document_references
<block_document_id>
is the ID of the block document to resolve.
Once the block document is retrieved from the API, the data of the block document
is used to replace the reference.
prefect.blocks.<block_type_slug>.<block_document_name>.value.key
Example: Returns {"nested-key": "nested-value"}
prefect.blocks.<block_type_slug>.<block_document_name>.value.key.nested-key
Example: Returns "nested-value"
prefect.blocks.<block_type_slug>.<block_document_name>.value.list[0].list-key
Example: Returns "list-value"
value
attribute, this attribute is resolved by default.
Args:
template
: The template to resolve block documents invalue_transformer
: A function that takes the block placeholder and the block value and returns replacement text for the templateresolve_variables
template
: The template to resolve variables inPlaceholderType
Placeholder