easyfabric.load_data_gold
logging
DataFrame
config
ConfigManager
LoadConfig
Model
initialize_config
get_log_file_path
init_logging
dataframe_to_gold
layer
modelloader
def modelloader(data_frame: DataFrame,
load_config: LoadConfig,
model_config: Model,
config_manager: ConfigManager = 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 andModel5 is True.