snowflake-sqlalchemy icon indicating copy to clipboard operation
snowflake-sqlalchemy copied to clipboard

SNOW-1348391: Unable to use query_tag in Snowflake-SQLAlchemy

Open NehaNRane opened this issue 10 months ago • 3 comments

What is the current behavior?

Currently, the Snowflake-SQLAlchemy library does not support the query_tag parameter when executing queries against Snowflake. The query_tag parameter allows users to attach custom metadata to their queries, facilitating query identification, resource management, and performance optimization within the Snowflake environment.

Reasons for Using query_tag:

  1. Query Identification: With query_tag, users can label their queries with custom metadata, making it easier to identify and categorize queries within Snowflake's query history and performance monitoring tools.
  2. Resource Management: By associating queries with specific application components or business processes, users can track resource consumption and allocate resources more effectively.
  3. Performance Optimization: query_tag enables users to analyze query performance based on custom criteria, such as application version, user role, or geographic location, leading to more targeted optimization efforts.

What is the desired behavior?

Users should be able to include the query_tag in session_parameter in their SQLAlchemy queries when connecting to Snowflake, with the specified tag being propagated to Snowflake and associated with the corresponding query execution.

How would this improve snowflake-connector-python?

Add support for the query_tag in session_parameter in the Snowflake-SQLAlchemy library, allowing users to specify custom query tags when executing queries. This enhancement will provide users with greater flexibility and control over query metadata, improving query management and performance monitoring capabilities.

The addition of query_tag support in Snowflake-SQLAlchemy will align the library more closely with Snowflake's capabilities and best practices, enhancing the overall user experience and enabling more sophisticated query management strategies.

References, Other Background

https://github.com/snowflakedb/snowflake-sqlalchemy/issues/266

NehaNRane avatar Apr 26 '24 15:04 NehaNRane