Skip to content

Commit 87157ec

Browse files
committed
fixes for failing tests
1 parent d480d07 commit 87157ec

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

pydruid/db/sqlalchemy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ def do_ping(self, dbapi_connection) -> bool:
123123
Return if the database can be reached.
124124
"""
125125
try:
126-
dbapi_connection.execute(text("SELECT 1"))
127-
except Exception as ex:
126+
dbapi_connection.execute("SELECT 1")
127+
except Exception:
128128
return False
129129

130130
return True

pydruid/query.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,8 @@ def parse_datasource(datasource, query_type):
246246
"Datasource definition not valid. Must be string or "
247247
"dict or list of strings"
248248
)
249+
if isinstance(datasource, list):
250+
return {"type": "union", "dataSources": datasource}
249251
return datasource
250252

251253
@staticmethod

tests/db/test_cursor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ def test_ssl_client_cert_authentication_with_patch_imported(
355355
ANY,
356356
stream=True,
357357
headers={"Content-Type": "application/json"},
358-
json={"query": "SELECT * FROM table", "context": {}, "header": False},
358+
json={"query": "SELECT * FROM table", "context": {}, "header": True},
359359
auth=ANY,
360360
verify=True,
361361
cert="path/to/cert",

0 commit comments

Comments
 (0)