Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

query tags integration#663

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@sreekanth-db
Copy link
Contributor

@sreekanth-dbsreekanth-db commentedAug 5, 2025
edited
Loading

What type of PR is this?

  • Refactor
  • Feature
  • Bug Fix
  • Other

Description

This PR addsQuery Tags support to the Python SQL Connector. Query Tags allow users to attach key-value pairs to SQL executions that appear in thesystem.query.history table.

Changes Made:

  1. Created Example File (examples/query_tags_example.py):

    • New file demonstrating Query Tags usage with session configuration
  2. Enhanced Integration Test (tests/e2e/test_driver.py):

    • Modifiedtest_ssp_passthrough() to include Query Tags in session configuration
    • Added parametrization to test both Thrift and SEA backends
  3. Enhanced Unit Tests (tests/unit/test_session.py):

    • Updatedtest_configuration_passthrough() test to verify query tags are properly passed through to the thrift backend
    • Updatedtest_session_management() to include query tags in session configuration to ensure query tags work correctly in SEA backend

Implementation Details:

Added Query Tags Support in SEA flow (src/databricks/sql/backend/sea/utils/constants.py):

  • Added"QUERY_TAGS": "" toALLOWED_SESSION_CONF_TO_DEFAULT_VALUES_MAP to enable query tags support in the SEA (Statement Execution API) backend flow

Usage example:

importdatabricks.sqlconnection=databricks.sql.connect(server_hostname='host',http_path='/sql/1.0/warehouses/xxx',access_token='token',session_configuration={'QUERY_TAGS':'team:engineering,test:query-tags','ansi_mode':False    })

How is this tested?

  • Unit tests
  • E2E Tests
  • Manually
  • N/A

Testing Details:

Unit Tests:

  • test_configuration_passthrough() - Verifies Query Tags flow in thrift mode
  • test_session_management() - Verifies Query Tags flow in SEA mode
  • All existing tests still pass

E2E Tests:

  • Enhancedtest_ssp_passthrough() to include Query Tags in both thirft and SEA modes

Manual Testing:

  • Ranexamples/query_tags_example.py with real backend connection
  • Verified Query Tags are accepted and queries execute successfully

Related Tickets & Documents

Signed-off-by: Sreekanth Vadigi <sreekanth.vadigi@databricks.com>
Signed-off-by: Sreekanth Vadigi <sreekanth.vadigi@databricks.com>
Copy link
Contributor

@samikshya-dbsamikshya-db left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

a minor nit, otherwise LGTM. Thanks for making the change

Signed-off-by: Sreekanth Vadigi <sreekanth.vadigi@databricks.com>
@sreekanth-dbsreekanth-db merged commitbcab1df intodatabricks:mainAug 25, 2025
27 of 29 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@samikshya-dbsamikshya-dbsamikshya-db approved these changes

@shivam2680shivam2680shivam2680 left review comments

@nikhilsuri-dbnikhilsuri-dbnikhilsuri-db left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@sreekanth-db@samikshya-db@shivam2680@nikhilsuri-db

[8]ページ先頭

©2009-2025 Movatter.jp