Skip to content

Conversation

@SamWheating
Copy link
Contributor

@SamWheating SamWheating commented Sep 26, 2025

A few of these tests are failing on master currently:

> pytest
...
================================================================= short test summary info ==================================================================
FAILED tests/test_query.py::TestQueryBuilder::test_union_datasource - AssertionError: assert {'dataSource'...ryType': None} == {'dataSource'...ryType': N...
FAILED tests/db/test_cursor.py::CursorTestSuite::test_ssl_client_cert_authentication_with_patch_imported - AssertionError: expected call not found.
FAILED tests/db/test_druid_dialect.py::DruidDialectTestSuite::test_do_ping_success - AssertionError: expected call not found.
============================================================== 3 failed, 124 passed in 0.52s ===============================================================

I have made what I think is the most reasonable correction in each case, either reverting breaking code changes or fixing up tests and left comments on this PR explaining my rationale. Let me know what you think!

"Datasource definition not valid. Must be string or "
"dict or list of strings"
)
if isinstance(datasource, list):
Copy link
Contributor Author

@SamWheating SamWheating Sep 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a revert of a change made in this commit, which I think was a breaking change to the generation of queries on union datasources. The PR doesn't offer additional details on this change, but the current code goes against the stated behaviour in the docstring and causes test failures.

It looks like the change in question never made it to a release, so I think it should be safe to just return to the previous behaviour.

stream=True,
headers={"Content-Type": "application/json"},
json={"query": "SELECT * FROM table", "context": {}, "header": False},
json={"query": "SELECT * FROM table", "context": {}, "header": True},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The header is set to True on line 352:

cursor = Cursor(url, header=True, ssl_client_cert="path/to/cert")

So I have to assume that the False here is just a typo 🤷

try:
dbapi_connection.execute(text("SELECT 1"))
except Exception as ex:
dbapi_connection.execute("SELECT 1")
Copy link
Contributor Author

@SamWheating SamWheating Sep 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a partial revert of this commit, which caused test failures because text("SELECT 1") != "SELECT 1" .

Based on this previous PR, using text() here causes issues for SQLAlchemy and should be avoided.

cc @betodealmeida - do you know why this was changed back to text()?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant