easyfabric.load_data_gold
modelloader
def modelloader(data_frame: DataFrame,
load_config: LoadConfig,
model_config: Model,
config_manager: ConfigManager = None) -> str | None
Loads data into the gold layer of a data platform using the specified configurations and model.
This function handles loading a DataFrame into the data platform's "gold" layer.
It configures logging, saves metadata, and uses the provided model configuration
to apply necessary transformations and loading procedures. Proper initialization
of LoadConfig, Model, and ConfigManager is required before calling this function.
Arguments:
data_frameDataFrame - The data to be loaded into the platform.load_configLoadConfig - Configuration settings for the loading process.model_configModel - Model configuration required for transformations and validations.config_managerConfigManager - Manages configuration details and ensures proper initialization.
Returns:
str- A string indicating the outcome of the loading process, or None if successful.
Raises:
Exception- Ifload_config.model_object_nameis missing.Exception- Ifconfig_manageris not properly initialized.Exception- Ifmodel_configis not provided.Exception- If an error occurs during processing andconfig_manager.stop_at_erroris True.