Skip to content

Commit 42b54f4

Browse files
committed
fix httpx timeout issue
1 parent 556da24 commit 42b54f4

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ wheels/
2626
.installed.cfg
2727
*.egg
2828
.vscode/
29+
.DS_Store
2930

3031
# PyInstaller
3132
# Usually these files are written by a python script from a template

pinotdb/db.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ def __init__(
286286
# TODO: Remove this unused parameter when we can afford to break the
287287
# interface (e.g. new minor version).
288288
verify_ssl=True,
289+
timeout=10,
289290
extra_request_headers="",
290291
debug=False,
291292
preserve_types=False,

pinotdb/sqlalchemy.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ def __init__(self, *args, **kwargs):
163163
self._password = None
164164
self._debug = False
165165
self._verify_ssl = True
166+
self._timeout = 10.0
166167
self._database = None
167168
self.update_from_kwargs(kwargs)
168169

@@ -181,6 +182,7 @@ def update_from_kwargs(self, givenkw):
181182
kwargs["database"] = self._database = kwargs.pop("database")
182183
kwargs["debug"] = self._debug = bool(kwargs.get("debug", False))
183184
kwargs["verify_ssl"] = self._verify_ssl = (str(kwargs.get("verify_ssl", "true")).lower() in ['true'])
185+
kwargs["timeout"] = self._timeout = kwargs.get("timeout", None)
184186
logger.info(
185187
"Updated pinot dialect args from %s: %s and %s",
186188
dict(map(lambda kv: (kv[0], mask_value(kv[0], kv[1], ['password'])), kwargs.items())),
@@ -207,6 +209,7 @@ def create_connect_args(self, url):
207209
"username": url.username,
208210
"password": url.password,
209211
"verify_ssl": self._verify_ssl or True,
212+
"timeout": self._timeout or 10.0,
210213
}
211214
if self.engine_type == "multi_stage":
212215
kwargs.update({"use_multistage_engine": True})

poetry.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)