data_loader
Module for loading data from either CSV files or SQL queries based on dataset configuration.
This module provides a flexible data loading function that can handle both CSV files and SQL queries based on the configuration keys present in the dataset configuration.
load_devices_datasets(pipeline_config)
Load device datasets from either CSV files or SQL queries based on configuration.
This function dynamically determines the loading method based on the configuration keys present in each dataset configuration: - "filepath_or_buffer": Loads from CSV file - "sql_query_path": Loads from SQL query
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pipeline_config
|
Config
|
The configuration object containing dataset information and SQL server connection. |
required |
Returns:
| Type | Description |
|---|---|
dict of dict
|
Dictionary containing dataset names as keys and dictionaries with "data" key containing the loaded DataFrame. |
Raises:
| Type | Description |
|---|---|
NoDatasetsProvidedError
|
If the |
ValueError
|
If SQL query path is provided but no SQL server connection exists. |
FileNotFoundError
|
If a SQL query file cannot be found or read. |