Storm test suite fails when using psycopg2 2.2
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Storm |
Fix Released
|
Medium
|
James Henstridge |
Bug Description
There are a number of failures in the Storm test suite when using psycopg2 2.2 as the database adapter.
The 2.2 release changed how psycopg2.Binary() objects are interpolated in queries to include an explicit cast. This shouldn't be a problem for cases where we want to include binary data, but it seems there are a few cases where we pass byte strings down that should be treated as text.
Below are the reported failures:
=======
ERROR: test_case_
-------
Traceback (most recent call last):
File "tests/mocker.py", line 102, in test_method_wrapper
result = test_method()
File "tests/
result = self.connection
File "storm/
return Connection.
File "storm/
raw_cursor = self.raw_
File "storm/
return Connection.
File "storm/
self.
File "storm/
return function(*args, **kwargs)
ProgrammingError: operator does not exist: text ~~ bytea
LINE 1: ...FROM like_case_
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
=======
ERROR: test_case_
-------
Traceback (most recent call last):
File "tests/mocker.py", line 102, in test_method_wrapper
result = test_method()
File "tests/
result = self.connection
File "storm/
return Connection.
File "storm/
raw_cursor = self.raw_
File "storm/
return Connection.
File "storm/
self.
File "storm/
return function(*args, **kwargs)
ProgrammingError: operator does not exist: text ~~* bytea
LINE 1: ...FROM like_case_
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
=======
ERROR: test_case_
-------
Traceback (most recent call last):
File "tests/mocker.py", line 102, in test_method_wrapper
result = test_method()
File "tests/
result = self.connection
File "storm/
return Connection.
File "storm/
raw_cursor = self.raw_
File "storm/
return Connection.
File "storm/
self.
File "storm/
return function(*args, **kwargs)
ProgrammingError: operator does not exist: text ~~ bytea
LINE 1: ...FROM like_case_
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
=======
ERROR: test_get_
-------
Traceback (most recent call last):
File "tests/mocker.py", line 102, in test_method_wrapper
result = test_method()
File "tests/
result = self.connection
File "storm/
return Connection.
File "storm/
raw_cursor = self.raw_
File "storm/
return Connection.
File "storm/
self.
File "storm/
return function(*args, **kwargs)
ProgrammingError: operator does not exist: character varying = bytea
LINE 1: ... = (SELECT currval(
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
=======
ERROR: test_set_
-------
Traceback (most recent call last):
File "tests/mocker.py", line 102, in test_method_wrapper
result = test_method()
File "tests/
self.
File "storm/store.py", line 490, in flush
self.
File "storm/store.py", line 552, in _flush_one
self.
File "storm/
return Connection.
File "storm/
raw_cursor = self.raw_
File "storm/
return Connection.
File "storm/
self.
File "storm/
return function(*args, **kwargs)
ProgrammingError: column "value" is of type numeric but expression is of type bytea
LINE 1: UPDATE money SET "value"
HINT: You will need to rewrite or cast the expression.
-------
Ran 2432 tests in 145.240s
FAILED (errors=5)
Related branches
- John O'Brien (community): Approve
- Thomas Herve (community): Approve
-
Diff: 83 lines (+9/-8)4 files modifiedNEWS (+1/-0)
storm/variables.py (+1/-1)
tests/databases/base.py (+1/-1)
tests/databases/postgres.py (+6/-6)
Changed in storm: | |
milestone: | none → 0.17 |
Changed in storm: | |
assignee: | nobody → James Henstridge (jamesh) |
importance: | Undecided → Medium |
status: | New → In Progress |
Changed in storm: | |
milestone: | 0.17 → 0.18 |
Changed in storm: | |
status: | In Progress → Fix Committed |
Changed in storm: | |
status: | Fix Committed → Fix Released |