You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My company is using query tags in Snowflake to do cost reporting. I was trying to find a way to set query tags at the session level, but it looks like that's not supported at the moment. It could also be useful to set them at the model level.
timezone can be set in the session.
From doing code with this in the past I believe the query tag has to be set once the session is obtained using an alter session.
Would all session parameters need to be listed and documented or could you do it in a generic way running alter session set key = value for all the extra ones? There's a lot of parameters in Snowflake and even more in spark and I wouldn't expect sqlmesh to support all of them explicitly and with documentation, but passing them through would be great. https://docs.snowflake.com/en/sql-reference/parameters
Workaround: for now I can set the timezone in the models that need it with a pre-statement, but setting the query tag and other parameters in every model would get annoying and it would be easy to miss one. I would also need the query tags to be on every query in the sessions and not just the ones directly in the models.
The text was updated successfully, but these errors were encountered:
My company is using query tags in Snowflake to do cost reporting. I was trying to find a way to set query tags at the session level, but it looks like that's not supported at the moment. It could also be useful to set them at the model level.
Looking at the python session for Snowflake: https://docs.snowflake.com/en/developer-guide/python-connector/python-connector-api#label-snowflake-connector-methods-connect
timezone can be set in the session.
From doing code with this in the past I believe the query tag has to be set once the session is obtained using an alter session.
Would all session parameters need to be listed and documented or could you do it in a generic way running alter session set key = value for all the extra ones? There's a lot of parameters in Snowflake and even more in spark and I wouldn't expect sqlmesh to support all of them explicitly and with documentation, but passing them through would be great.
https://docs.snowflake.com/en/sql-reference/parameters
Docs on what Sqlmesh supports currently for Snowflake:
https://sqlmesh.readthedocs.io/en/stable/integrations/engines/snowflake/#installation
I believe this is the relevant code:
sqlmesh/sqlmesh/core/config/connection.py
Line 317 in 9087309
In the code for dbt query tag is seen, but I believe it falls through the cracks and isn't used.
sqlmesh/sqlmesh/dbt/target.py
Line 253 in c685b18
Workaround: for now I can set the timezone in the models that need it with a pre-statement, but setting the query tag and other parameters in every model would get annoying and it would be easy to miss one. I would also need the query tags to be on every query in the sessions and not just the ones directly in the models.
The text was updated successfully, but these errors were encountered: