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

accepting query_tag as session_parameters in connection arguments

Open NehaNRane opened this issue 10 months ago • 2 comments

Please answer these questions before submitting your pull requests. Thanks!

  1. What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.

    Fixes #495

  2. Fill out the following pre-review checklist:

    • [x] I am adding a new automated test(s) to verify correctness of my new code
    • [x] I am adding new logging messages
    • [x] I am adding new credentials
    • [x] I am adding a new dependency
  3. Please describe how your code solves the related issue. The solution involves integrating the query_tag parameter into the session_parameters dictionary. This dictionary is part of the connection arguments used when establishing a connection to Snowflake through SQLAlchemy. By including query_tag in session_parameters, users can specify a custom query tag to be associated with their queries.

If the user does not explicitly provide a query_tag, the library will revert to its current behavior. In this case, no query tag will be attached to the executed queries. This ensures backward compatibility with existing codebases and prevents any unintended changes in behavior for users who do not wish to utilize the query_tag functionality.

If the user provides a query_tag in the session_parameters dictionary, the library will extract it and set it in the queries being executed against Snowflake. This allows users to dynamically specify custom query tags based on their requirements.

NehaNRane avatar Apr 26 '24 15:04 NehaNRane