Skip to content

Commit 3c631b9

Browse files
committed
fixes for failing tests
1 parent d480d07 commit 3c631b9

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

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",

tests/db/test_druid_dialect.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import warnings
55
from unittest.mock import patch
66

7-
from sqlalchemy import exc, types
7+
from sqlalchemy import exc, types, text
88

99
from pydruid.db.sqlalchemy import DruidDialect
1010

@@ -91,7 +91,9 @@ def test_do_ping_success(self, connection_mock):
9191
result = self.dialect.do_ping(connection_mock)
9292

9393
# asserts the ping executes with a raw string
94-
connection_mock.execute.assert_called_once_with("SELECT 1")
94+
connection_mock.execute.assert_called_once()
95+
called_query = connection_mock.execute.call_args[0][0]
96+
self.assertEqual(called_query.text, "SELECT 1")
9597
self.assertTrue(result)
9698

9799
@patch("pydruid.db.api.Connection")

0 commit comments

Comments
 (0)