Skip to content

Commit ca33c73

Browse files
committed
SA14/Tests: Remove masking the resultproxy and fix setup of fake cursors
Beforehand, after observing errors like:: RuntimeError: number of values in row (1) differ from number of column processors (0) we decided to take the `resultproxy` out of the equation in order to work on the real gist of SQLAlchemy 1.4 compatibility. When looking at this again, it turned out that the root cause have been inaccuracies when setting up fake cursors within the test cases. SQLAlchemy <1.4 might have been more forgiving on that, but >=1.4 isn't.
1 parent 0e5b785 commit ca33c73

File tree

3 files changed

+1
-50
lines changed

3 files changed

+1
-50
lines changed

src/crate/client/sqlalchemy/dialect.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@
2222
import logging
2323
from datetime import datetime, date
2424

25-
# FIXME: Workaround to be able to use SQLAlchemy 1.4.
26-
# Caveat: This purges the ``cresultproxy`` extension
27-
# at runtime, so it will impose a speed bump.
28-
import crate.client.sqlalchemy.monkey # noqa:F401, lgtm[py/unused-import]
29-
3025
from sqlalchemy import types as sqltypes
3126
from sqlalchemy.engine import default, reflection
3227
from sqlalchemy.sql import functions

src/crate/client/sqlalchemy/monkey.py

Lines changed: 0 additions & 44 deletions
This file was deleted.

src/crate/client/sqlalchemy/tests/dict_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def test_assign_null_to_object_array(self):
138138
@patch('crate.client.connection.Cursor', FakeCursor)
139139
def test_assign_to_craty_type_after_commit(self):
140140
session, Character = self.set_up_character_and_cursor(
141-
return_value=[('Trillian', None, None)]
141+
return_value=[('Trillian', None)]
142142
)
143143
char = Character(name='Trillian')
144144
session.add(char)

0 commit comments

Comments
 (0)