accepting query_tag as session_parameters in connection arguments #496
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please answer these questions before submitting your pull requests. Thanks!
What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Fixes SNOW-1348391: Unable to use query_tag in Snowflake-SQLAlchemy #495
Fill out the following pre-review checklist:
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.