Skip to main content

PathRewrite

Configuration for rewriting paths during input loading.

Attributes

AttributeTypeDescription
old_prefixstrIf set, rewrites any path starting with this prefix to the new prefix.
new_prefixstrThe replacement string used to substitute the matching old_prefix in the path.

Constructor

Signature

def PathRewrite(
old_prefix: str,
new_prefix: str
) - > null

Parameters

NameTypeDescription
old_prefixstrThe original path prefix to be replaced.
new_prefixstrThe new path prefix to replace the old one with.

Methods


from_str()

@classmethod
def from_str(
pattern: string
) - > [PathRewrite](pathrewrite.md?sid=flyte_models_pathrewrite)

Create a PathRewrite from a string pattern of the form old_prefix- >new_prefix.

Parameters

NameTypeDescription
patternstringThe string representation of the rewrite rule using '- >' as a delimiter between the source and target prefixes.

Returns

TypeDescription
[PathRewrite](pathrewrite.md?sid=flyte_models_pathrewrite)A new instance of PathRewrite configured with the parsed prefixes.