src.utils.snowflake
src.utils.snowflake.
logger
config
channel_like
column_details
(BOXID VARCHAR(50), L VARCHAR(5), YEAR NUMBER(4), WEEK NUMBER(2), PROCESSED_ON TIMESTAMP_TZ, MAX DOUBLE, MIN DOUBLE)
format_connection
Get (connection) details in the right format for different tables.
name
of
the
different
sources
Connection
read_meta
Read meta preprocess of DALI box.
list
ID of DALI box to read. None results in all available preprocess of DALI boxes that have nominal power specified.
pd.DataFrame
with
make_week_extremes_query
Build the query to request week extremes.
If not None: select specific boxes.
Date to determine week extremes from. Cuts are always made on the last monday.
str
Query string.
create_table_query
Make query to create or replace table and insert preprocess of select query.
Select query to be used.
New query
insert_table_query
Make query to insert preprocess of select query in an existing table.
create_week_extremes
Execute query to create whole new table of week extremes asynchroniously.
get_last_processed_time
Retrieve last time table update has been done.
datetime
Last processing time.
update_week_extremes
Update week extremes from last processing time upt o last monday.
read_week_extremes
Read week extremes for a DALI box and phase.
If not None: A list with DALI box IDs to read.
The phases to retrieve (sumli, L1, L2, L3)
Week extremes.
clear_forecasts
Clear the table with forecasts.
None
clear_forecast_meta
Clear the table with forecast metadata.
write_forecasts
Write results into the Snowflake database.
Results to write.
write_forecast_meta
Write assessment of forecast on capacity to forecast metadata table in Snowflake.
Assessment results.
read_forecasts
Read forecasts for Snowflake database.
Boxid of a DALI box. If not provided or None, all forecast are loaded.
DataFrame with forecasts.
read_forecast_meta
Read assessment of forecasts.
Results of he assessment of all DALI box forecasts.
get_forecasted_boxids
Get the boxids for boxes that are already forecasted.
(Should be adapted when multiple forecasts (done on different dates) are present in database).
Unique boxids.
src.utils.preprocess
src.utils.vault