How will SQLAlchemy's implementation of an async extension affect this project? #484
brian-farrell
started this conversation in
Potential issue
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm curious as to how closely this project intends to conform with SQLAlchemy, and whether there is an intention to carry this project forward once SQLAlchemy has fully implemented its async extension.
I'm asking this because I ran into an issue with the Deprecation Warnings in the
backends.postgres.Record
class. (For thekeys()
andvalues()
methods. My own code was was instantiating a new class object by unpacking theRecord
object.i.e.:
Class(**record)
. The deprecation warnings showed up during unit testing, and the cause was not readily apparent, which caused me to dig into this code, as well as into some of the SQLAlchemy code.The Deprecation Warnings indicate that, for instance, "The
Row.keys()
method is deprecated to mimic SQLAlchemy behaviour, useRow._mapping.keys()
instead." In my case, I refactored my code toClass(**dict(record._mapping.items()))
. This is acceptable, but less than optimal.In looking through the code, I noticed several significant differences between the Databases
Record
class and the SQLAlchemyRow
class. I'm happy to submit a Pull Request that would get theRecord
class to behave more like the SQLAlchemyRow
class, but I am not sure if that work is desired or particularly useful, depending on the direction of this project.If there is a desire for help with this work, please let me know, and I will be happy to contribute.
References:
Databases version: 0.5.5
SQLAlchemy version: 1.4.35
Python version: 3.9.12
OS: Debian 10.12
SQLAlchemy Row Documentation
SQLAlchemy Asynchronous I/O Documentation
Beta Was this translation helpful? Give feedback.
All reactions