loaders.emptytable
delete_bronze
def delete_bronze(table_config: TableConfig, config_manager: ConfigManager)
Deletes all data from a specified bronze lakehouse table and refreshes the table cache.
Arguments:
table_config
TableConfig - Configuration object containing the table details.config_manager
ConfigManager - Configuration manager to retrieve lakehouse and schema details.
Raises:
Exception
- If no bronze lakehouse is found in the configuration.
delete_silver
def delete_silver(table_config: TableConfig, config_manager: ConfigManager)
Deletes all data from the specified silver table and refreshes the cache to ensure the latest state of the table is visible for subsequent operations. This function retrieves the silver lakehouse configuration, constructs the necessary table name and performs deletion using Spark.
Arguments:
table_config
TableConfig - Configuration object that provides table-related information such as table names. It is used to determine the silver table name linked to the provided configuration.config_manager
ConfigManager - Configuration manager instance that provides access to various lakehouse configurations, including the silver lakehouse details required for this operation.
Raises:
Exception
- If no silver lakehouse is found in the configuration. An error is logged before raising this exception to provide insight into the root cause.