-
Notifications
You must be signed in to change notification settings - Fork 4
Add SQLAlchemy Test Suite and Fix Dialect #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I'm working on fixing CI tests. This pipenv thing is ugly when you've not used it before. |
Yes, if we start a query to the server and do not poll the data, the server will mark the session as expired. So I open an issue on #23. By default, we should disable stream_results so it'll finish the whole query inside a loop and cache the results in memory to iterator. |
# ToDo - get this working, failing because cannot substitute bytes parameter into sql statement | ||
# CREATE TABLE binary_test (x binary not null) | ||
# INSERT INTO binary_test (x) values (b'7\xe7\x9f') ??? | ||
# It is possible to do this | ||
# INSERT INTO binary_test (x) values (TO_BINARY('7\xe7\x9f')) | ||
# but that's not really a solution I don't think | ||
@testing.skip("databend") | ||
def test_binary_roundtrip(self): | ||
pass | ||
|
||
@testing.skip("databend") | ||
def test_pickle_roundtrip(self): | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hantmac Maybe you have a suggestion how I may get these binary tests working? Currently it is not possible to insert binary data using the dialect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/LGTM 🚀
After experiencing a number of issues with the dialect, I incorporated the SQLAlchemy test suite and adapted the dialect to pass the tests. The previous unit and integration tests are basically redundant following this change, but I have updated them to pass but they do not work alongside the SQLAlchemy tests. To incorporate those, they just need to be turned into classes descending from SQLalchemy
TestBase
class, but the tests therein are easily covered by the test suite.One problem noticed is that statements executed against the databend server record timeouts on the server. It's like the cursor.close() does nothing - that's probably a driver issue I assume - although the cursor close does nothing in the dialect here, but there is no driver method to call.
This will address issue #24 #25 #26