Skip to content

File Mover Result

Bases: FileResult

Representation of file move result.

Container for file paths, divided into certain categories:

Added in 0.8.0

Examples:

>>> from onetl.file import FileMover
>>> mover = FileMover(local_path="/local", ...)
>>> move_result = mover.run(
...     [
...         "/source/file1",
...         "/source/file2",
...         "/failed/file",
...         "/existing/file",
...         "/missing/file",
...     ]
... )
>>> move_result
MoveResult(
    successful=FileSet([
        RemoteFile("/target/file1"),
        RemoteFile("/target/file2"),
    ]),
    failed=FileSet([
        FailedLocalFile("/failed/file")
    ]),
    skipped=FileSet([
        RemoteFile("/existing/file")
    ]),
    missing=FileSet([
        RemotePath("/missing/file")
    ]),
)

successful = Field(default_factory=FileSet) class-attribute instance-attribute

File paths (local) which were moved successfully

failed = Field(default_factory=FileSet) class-attribute instance-attribute

File paths (remote) which were not moved because of some failure

skipped = Field(default_factory=FileSet) class-attribute instance-attribute

File paths (remote) which were skipped because of some reason

missing = Field(default_factory=FileSet) class-attribute instance-attribute

File paths (remote) which are not present in the remote file system