crate / sqlalchemy-cratedb

SQLAlchemy dialect for CrateDB.
https://cratedb.com/docs/sqlalchemy-cratedb/
Apache License 2.0
3 stars 2 forks source link

SA20: Resolve all deprecation warnings using `SQLALCHEMY_WARN_20=1` #111

Closed amotl closed 1 year ago

amotl commented 1 year ago

About

When running the test suite, it triggers a few deprecation warnings:

<stdin>:1: MovedIn20Warning: The ``declarative_base()`` function is now available as sqlalchemy.orm.declarative_base(). (deprecated since: 1.4) (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9)
<stdin>:1: RemovedIn20Warning: The ``bind`` argument to declarative_base is deprecated and will be removed in SQLAlchemy 2.0. (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9)

I was following the steps described here, but on the following connection.execute I get a crate.client.exceptions.ProgrammingError: RelationUnknown[Relation 'locations' unknown]. Is there a step missing to run the table creation? And how does it later return a row count of 13, where are these rows coming from?

References

_Originally posted by @hammerhead in https://github.com/crate/crate-python/pull/464#discussion_r1044165573_

amotl commented 1 year ago

I think I had already made a start on this at a single spot when looking at SA20 compatibility. See db3831a05480. However, let's dedicate a patch to getting rid of deprecation warnings only, without making further changes.

amotl commented 1 year ago

Resolved with crate/crate-python#485.