MonetDB / sqlalchemy-monetdb

A SQLAlchemy dialect for MonetDB
MIT License
41 stars 17 forks source link

Release a new version on PyPi #45

Open MitchellWeg opened 2 years ago

MitchellWeg commented 2 years ago

Commit #42 contains an important fix that makes it possible for this driver to work on the newer Python versions. Would it be possible to create a new release and release it on PyPi?

gijzelaerr commented 2 years ago

will do, but i prefer to first make sure the test suite passes first, currently it doesn't https://github.com/gijzelaerr/sqlalchemy-monetdb/actions/runs/1818959959

MitchellWeg commented 2 years ago

That's cool. I tried to do some digging, but I haven't quite got the problem yet. I suspect there was a change in the way connection strings are parsed from 1.4.0 onwards, because before that it still worked.

MitchellWeg commented 2 years ago

I got the test-suite to work, however a lot of tests still fail. Alot of the tests fail in Pymonetdb and not sqlalchemy_monetdb:

Traceback (most recent call last):
  File "/home/mitchell/Documents/Werk/SQLAlchemy/sqlalchemy-monetdb/.tox/py3.9/lib64/python3.9/site-packages/sqlalchemy/engine/base.py", line 1702, in _execute_context
    context = constructor(
  File "/home/mitchell/Documents/Werk/SQLAlchemy/sqlalchemy-monetdb/.tox/py3.9/lib64/python3.9/site-packages/sqlalchemy/engine/default.py", line 1091, in _init_compiled
    param = {
  File "/home/mitchell/Documents/Werk/SQLAlchemy/sqlalchemy-monetdb/.tox/py3.9/lib64/python3.9/site-packages/sqlalchemy/engine/default.py", line 1092, in <dictcomp>
    key: processors[key](compiled_params[key])
  File "/home/mitchell/Documents/Werk/SQLAlchemy/sqlalchemy-monetdb/.tox/py3.9/lib64/python3.9/site-packages/sqlalchemy/sql/sqltypes.py", line 993, in process
    return DBAPIBinary(value)
  File "/home/mitchell/Documents/Werk/SQLAlchemy/sqlalchemy-monetdb/.tox/py3.9/lib/python3.9/site-packages/pymonetdb/sql/pythonize.py", line 183, in Binary
    return bytes.fromhex(data)
TypeError: fromhex() argument must be str, not bytes

which is this test:

    def test_binary_roundtrip(self, connection):
        binary_table = self.tables.binary_table

        connection.execute(
            binary_table.insert(), {"id": 1, "binary_data": b"this is binary"}
        )
        row = connection.execute(select(binary_table.c.binary_data)).first()
        eq_(row, (b"this is binary",))

https://github.com/sqlalchemy/sqlalchemy/blob/7920fa7995af83943560afc1a07dde4ebb4f9552/lib/sqlalchemy/testing/suite/test_types.py#L214

Should these tests be overridden, or do we need to change something in pymonetdb?