PathRewrite
Configuration for rewriting paths during input loading.
Attributes
| Attribute | Type | Description |
|---|---|---|
| old_prefix | str | If set, rewrites any path starting with this prefix to the new prefix. |
| new_prefix | str | The 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
| Name | Type | Description |
|---|---|---|
| old_prefix | str | The prefix string to match and rewrite. |
| new_prefix | str | The 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
| Name | Type | Description |
|---|---|---|
| pattern | str | The string pattern defining the path rewrite in 'old_prefix- >new_prefix' format. |
Returns
| Type | Description |
|---|---|
[PathRewrite](pathrewrite.md?sid=flyte_models_pathrewrite) | A new PathRewrite instance configured with the parsed old and new prefixes. |