dlt.common.storages.load_package
TJobFileFormat
Loader file formats with internal job types
TPipelineStateDoc Objects
class TPipelineStateDoc(TypedDict)
Corresponds to the StateInfo Tuple
TLoadPackageDropTablesState Objects
class TLoadPackageDropTablesState(TypedDict)
refresh
Refresh mode that generated the drop/truncate lists below
dropped_tables
List of tables that are to be dropped from the schema and destination (i.e. when refresh mode is used)
truncated_tables
List of tables that are to be truncated in the destination (i.e. when refresh='drop_data' mode is used)
TLoadPackageState Objects
class TLoadPackageState(TVersionedState, TLoadPackageDropTablesState)
created_at
Timestamp when the load package was created
pipeline_state
Pipeline state, added at the end of the extraction phase
destination_state
private space for destinations to store state relevant only to the load package
load_metrics
Per-job load metrics, persisted so they survive process restarts
applied_dropped_tables
Names of dropped_tables actually dropped at the destination by the load step
applied_truncated_tables
Names of truncated_tables actually truncated at the destination by the load step
abort_requested
Flag indicating the package should be aborted on next load
TLoadPackage Objects
class TLoadPackage(TypedDict)
load_id
Load id
state
State of the load package
create_load_id
def create_load_id() -> str
Creates new package load id which is the current unix timestamp converted to string. Load ids must have the following properties:
- They must maintain increase order over time for a particular dlt schema loaded to particular destination and dataset
dltexecutes packages in order of load idsdltconsiders a state with the highest load id to be the most up to date when restoring state from destination
ParsedLoadJobFileName Objects
class ParsedLoadJobFileName(NamedTuple)
Represents a file name of a job in load package. The file name contains name of a table, number of times the job was retried, extension and a 5 bytes random string to make job file name unique. The job id does not contain retry count and is immutable during loading of the data
job_id
def job_id() -> str
Unique identifier of the job
file_name
def file_name() -> str
A name of the file with the data to be loaded