-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update dbapi() to import_dbapi() #15
Conversation
I think this might be a good idea, wouldn't want to break things for people that happen to run old versions of things. |
I've added that in! |
Thank you! @adamchen could you test this as well? And would you like to release it? Let me know if you need any help or if you want me to make a new release. |
Thanks for adding this @david-engelmann, and thanks for taking a look @dirkjonker! I'm away this week without my laptop but happy to take a look when I'm back this weekend. |
@david-engelmann, which version of Python are you using to test? I'm using 3.8.2 and still seeing the deprecation warning. I think it's down to the following snippet in sqlalchemy.engine.create:
It seems that To me, this signifies we should probably be putting both the Let me know what you think, or if I've missed something |
@adamchen Great observation, I've moved the logic into the MSDialect_turbodbc and I'm seeing the warning removed for multiple python versions. I have left the original dbapi class method in connector.py but can remove it entirely, if we'd like |
I think the |
I figured, I'm definitely down to leave the dbapi method for backwards compatibility |
Good stuff, thanks @david-engelmann and appreciate the guidance @dirkjonker! I'll merge this and get a release built Weds. |
Latest Version of Turbodbc is raising this warning.
SADeprecationWarning: The dbapi() classmethod on dialect classes has been renamed to import_dbapi(). Implement an import_dbapi() classmethod directly on class <class 'sqlalchemy_turbodbc.dialect.MSDialect_turbodbc'> to remove this warning; the old .dbapi() classmethod may be maintained for backwards compatibility.
I've made that change and tested on this branch. The warning mentions that def dbapi(cls): can be kept as well if desired. I haven't in this branch but I'm happy to add it in before merging!