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 path prefix to substitute for matching path prefixes, which must be a non-empty string different from old_prefix.

Constructor​

Signature​

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

Parameters​

NameTypeDescription
old_prefixstrThe prefix string to match and rewrite.
new_prefixstrThe new prefix string to replace the old prefix with.

Methods​


from_str()​

@classmethod
def from_str(cls, pattern: str) -> PathRewrite: ...

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

Parameters​

NameTypeDescription
patternstrThe string pattern defining the path rewrite in 'old_prefix- >new_prefix' format.

Returns​

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