sqlanywhere / sqlalchemy-sqlany

SQLAlchemy driver for SAP Sybase SQL Anywhere
Apache License 2.0
12 stars 13 forks source link

typemap parameter has been deprecated in sqlalchemy #13

Closed hynek closed 3 years ago

hynek commented 5 years ago

As of sqlalchemy 1.3, using sqlalchemy-sqlany raises a warning:

<string>:2: SADeprecationWarning: The text.typemap parameter is deprecated and will be removed in a future release.  Please refer to the TextClause.columns() method.

I've tracked it back to this line:

https://github.com/sqlanywhere/sqlalchemy-sqlany/blob/f7b6622d8909ee67d41fc5c4c780f262c2b2f58a/sqlalchemy_sqlany/base.py#L466

hynek commented 3 years ago

For the record, SQLAlchemy 1.4 has been released on 2021-03-15 and is not compatible with sqlalchemy-sqlany anymore:

self = <sqlalchemy_sqlany.base.SQLAnyDialect object at 0x1076761c0>, connection = <sqlalchemy.engine.base.Connection object at 0x107732d90>

    def _get_default_schema_name(self, connection):
        return connection.scalar(
>                    text("SELECT current user",
                     typemap={'user_name': Unicode})
             )
E       TypeError: text() got an unexpected keyword argument 'typemap'

.direnv/python-3.9.2/lib/python3.9/site-packages/sqlalchemy_sqlany/base.py:465: TypeError
dekay2001 commented 3 years ago

For the record, SQLAlchemy 1.4 has been released on 2021-03-15 and is not compatible with sqlalchemy-sqlany anymore:

self = <sqlalchemy_sqlany.base.SQLAnyDialect object at 0x1076761c0>, connection = <sqlalchemy.engine.base.Connection object at 0x107732d90>

    def _get_default_schema_name(self, connection):
        return connection.scalar(
>                    text("SELECT current user",
                     typemap={'user_name': Unicode})
             )
E       TypeError: text() got an unexpected keyword argument 'typemap'

.direnv/python-3.9.2/lib/python3.9/site-packages/sqlalchemy_sqlany/base.py:465: TypeError

Bumping this. We just ran into this at my organization and its potentially a big problem for us that may force us to evaluate use of ASA in the long term. We have a lot of customers who rely on this integration working. Would like to see continued support of this library. Are there plans to fix this?

DanCummins-SAP commented 3 years ago

Hi Hynek and dekay2001,

Just to let you know we saw your messages and we are working on a fix.

Kind regards, Dan

DanCummins-SAP commented 3 years ago

May I close this issue? Kind regards, Dan

ASk1 commented 3 years ago

I think yes, this problem was solved But may be we need to bump the version up? With regards, Anatoli

hynek commented 2 years ago

Unfortunately the PyPI version is still broken. Could you please bump the version and upload it to PyPI?

TIA!

ASk1 commented 2 years ago

@DanCummins-SAP - please approve PR #15

DanCummins-SAP commented 2 years ago

I just posted this: https://pypi.org/project/sqlalchemy-sqlany/1.0.4/

Can you let me know your feedback? Thanks, Dan

hynek commented 2 years ago

It works for me.