We are using the DBT = 0.19.1.
In the model Pre-Hook, we have “alter session set timezone = ‘Australia/Melbourne’” as a pre hook.
When we run the model, as below
select convert_timezone(‘Australia/Melbourne’,getdate()) convert_date, getdate() get_date,current_timestamp curr_time
the table which is created doe not consider the session timezone which has been set and using the Account Level Timezone setting.
Note: Validate the session ID, for PreHook and Model, they are same
When we try the same steps on Snowflake UI & Python Connector 2.3.6 (DBT snowflake Adapter Version)
the result is as expected - Session TIMEZONE is getting properly applied
With the DBT, its not working, we have Query Tag as Pre hook and it works perfectly
Steps to Reproduce:
- create a model with below lines:
{{ config(
pre_hook = "alter session set timezone = 'Australia/Melbourne'"
) }}
select convert_timezone('Australia/Melbourne',getdate()) convert_date, getdate() get_date,current_timestamp curr_time
- Run the model
- Go to Snowflake and select * from model_name;