Skip to content

Commit 3848606

Browse files
authored
Merge pull request #156 from synccomputingcode/shughes/fix-httpx-compat
Fix compatiblity with httpx
2 parents f9f5679 + 745223a commit 3848606

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

sync/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""Library for leveraging the power of Sync"""
22

3-
__version__ = "1.11.6"
3+
__version__ = "1.11.7"
44

55
TIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ"

sync/clients/databricks.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from typing import Generator, Union
44

55
import httpx
6+
from packaging.version import Version
67

78
from sync.config import DB_CONFIG
89
from sync.models import Platform
@@ -24,12 +25,17 @@ def auth_flow(self, request: httpx.Request) -> Generator[httpx.Request, httpx.Re
2425

2526
class DatabricksClient(RetryableHTTPClient):
2627
def __init__(self, base_url: str, access_token: str):
28+
kwargs = {}
29+
if Version(httpx.__version__) < Version("0.26.0"):
30+
kwargs["proxies"] = os.getenv("FIXIE_URL")
31+
else:
32+
kwargs["proxy"] = os.getenv("FIXIE_URL")
2733
super().__init__(
2834
client=httpx.Client(
2935
base_url=base_url,
3036
headers={"User-Agent": DATABRICKS_USER_AGENT},
3137
auth=DatabricksAuth(access_token),
32-
proxies=os.getenv("FIXIE_URL"),
38+
**kwargs,
3339
)
3440
)
3541

0 commit comments

Comments
 (0)