Skip to main content

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_frame DataFrame - The data to be loaded into the platform.
  • load_config LoadConfig - Configuration settings for the loading process.
  • model_config Model - Model configuration required for transformations and validations.
  • config_manager ConfigManager - Manages configuration details and ensures proper initialization.

Returns:

  • str - A string indicating the outcome of the loading process, or None if successful.

Raises:

  • Exception - If load_config.model_object_name is missing.
  • Exception - If config_manager is not properly initialized.
  • Exception - If model_config is not provided.
  • Exception - If an error occurs during processing and Model5 is True.