Moe
07/12/2024, 6:41 PMTask parameter introspection took 13.455 seconds , exceeding `PREFECT_TASK_INTROSPECTION_WARN_THRESHOLD` of 10.0. Try wrapping large task parameters with `prefect.utilities.annotations.quote` for increased performance, e.g. `my_task(quote(param))`. To disable this message set `PREFECT_TASK_INTROSPECTION_WARN_THRESHOLD=0`
Nate
07/12/2024, 6:46 PMquote
if you're not passing futures. if you are passing futures, you can call .result on that before you pass it in and then use quoteMoe
07/12/2024, 6:53 PMNate
07/12/2024, 6:53 PMMoe
07/12/2024, 6:59 PMMoe
07/12/2024, 7:04 PMNate
07/12/2024, 7:05 PMPREFECT_TASK_INTROSPECTION_WARN_THRESHOLD
Moe
07/12/2024, 7:10 PM@task
def wd_save_to_land(data, connection, table_name):
df = pd.DataFrame(data)
cols_to_drop = list(set(df.columns) - set(WD_COLUMNS))
if len(cols_to_drop) > 0:
df = df.drop(cols_to_drop, axis=1)
df['land_inserted'] = utils.get_current_date_time()
df['Worker_s_Manager_group'] = df['Worker_s_Manager_group'].astype(str)
if utils.table_exists(connection, table_name):
utils.clear_table(connection, table_name)
<http://utils.logger.info|utils.logger.info>(f"existing records in {table_name} cleared...")
df.to_sql(table_name, con=connection, if_exists='append', index=False)
Nate
07/12/2024, 7:11 PMMoe
07/12/2024, 7:17 PMMoe
07/12/2024, 7:17 PMNate
07/12/2024, 7:17 PMquote
to avoid the error message
wd_save_to_land(quote(data), ...)
etcMoe
07/12/2024, 7:18 PMNate
07/12/2024, 7:20 PMMoe
07/12/2024, 7:21 PM