Skip to main content

RawDataPath

A class representing the raw data path for a task. This is used to store the raw data for the task execution and also get mutations on the path.

Attributes​

AttributeTypeDescription
pathstrThe base storage location string used for task execution data and as a prefix for generating remote paths.
path_rewriteOptional[[PathRewrite](pathrewrite.md?sid=flyte_models_pathrewrite)] = nullAn optional configuration object used to define rules for transforming or mutating the raw data path.

Constructor​

Signature​

def RawDataPath(
path: str,
path_rewrite: Optional[[PathRewrite](pathrewrite.md?sid=flyte_models_pathrewrite)] = None
) - > null

Parameters​

NameTypeDescription
pathstrThe string representation of the raw data path.
path_rewriteOptional[[PathRewrite](pathrewrite.md?sid=flyte_models_pathrewrite)] = NoneAn optional configuration for rewriting the path during task execution.

Methods​


from_local_folder()​

@classmethod
def from_local_folder(
local_folder: str | pathlib.Path | None = None
) - > [RawDataPath](rawdatapath.md?sid=flyte_models_rawdatapath)

Create a new context attribute object, with local path given. Will be created if it doesn't exist.

Parameters​

NameTypeDescription
local_folder`strpathlib.Path

Returns​

TypeDescription
[RawDataPath](rawdatapath.md?sid=flyte_models_rawdatapath)Path to the temporary directory

get_random_remote_path()​

@classmethod
def get_random_remote_path(
file_name: Optional[str] = None
) - > str

Returns a random path for uploading a file/directory to. This file/folder will not be created, it's just a path.

Parameters​

NameTypeDescription
file_nameOptional[str] = NoneAn optional filename to append to the randomly generated path segment.

Returns​

TypeDescription
strA unique, randomly generated absolute path string within the current data directory.