Refactor codebase to use a unified http client#673
Merged
vikrantpuppala merged 16 commits intomainfrom Aug 13, 2025
Merged
Conversation
Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>
Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>
Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>
Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>
Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>
vikrantpuppala
commented
Aug 11, 2025
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the codebase to use a unified HTTP client across all HTTP operations in the Databricks SQL connector. The primary purpose is to consolidate HTTP client usage, eliminating various singleton HTTP clients and direct requests library usage in favor of a single UnifiedHttpClient based on urllib3.
Key changes:
- Introduced
UnifiedHttpClientclass that provides a centralized HTTP client with retry policies, connection pooling, SSL support, and proxy support - Removed singleton HTTP clients (
DatabricksHttpClient,TelemetryHttpClient) and replaced directrequestsusage - Updated all components (auth, telemetry, staging operations, cloud fetch, feature flags) to use the unified client
Reviewed Changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/databricks/sql/common/unified_http_client.py |
New unified HTTP client implementation using urllib3 |
src/databricks/sql/client.py |
Updated to create and use unified HTTP client, replaced direct requests usage |
src/databricks/sql/session.py |
Modified to accept and use unified HTTP client |
src/databricks/sql/common/http.py |
Removed singleton HTTP client classes |
src/databricks/sql/auth/*.py |
Updated auth providers to use unified HTTP client |
src/databricks/sql/telemetry/telemetry_client.py |
Refactored to use unified client with singleton pattern |
tests/unit/*.py |
Updated tests to mock unified HTTP client |
jprakash-db
reviewed
Aug 11, 2025
Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>
Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>
Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>
Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>
vikrantpuppala
commented
Aug 12, 2025
Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>
jprakash-db
approved these changes
Aug 13, 2025
Contributor
jprakash-db
left a comment
There was a problem hiding this comment.
LGTM. Thanks for making the changes
Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>
Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>
jprakash-db
approved these changes
Aug 13, 2025
Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What type of PR is this?
Description
This PR refactors the codebase to use a unified HTTP client across all HTTP operations in the Databricks SQL connector. The primary purpose is to consolidate HTTP client usage, eliminating various singleton HTTP clients and direct requests library usage in favor of a single UnifiedHttpClient based on urllib3.
Key changes:
How is this tested?
Related Tickets & Documents