This PR fixes deprecations for Python 3.9 (some of which would be errors in 3.10) and for sqlalchemy 1.4. Maintains support on earlier Python and sqlalchemy. Closes #83.
For Python 3.9/3.10:
imports abstract base classes from collections.abc if possible (fallback to collections)
Replaces is string comparisons with ==
A little bit of style cleanup in directly-related lines
For sqlalchemy 1.4:
table_names() was removed (affects tests only)
mapped_table was replaced with persist_selectable (affects tests only)
Make a subquery into an explicit selection (DButils)
Make a subquery into an explicitly scalar subquery (newestVersionProblemFinder, which is untested)
This supersedes #84, which does not fix all warnings in #83 and didn't preserve namespacing on collections.
PR Checklist
[X] Pull request has descriptive title
[X] Pull request gives overview of changes
[X] New code has inline comments where necessary
[X] (N/A) Any new modules, functions or classes have docstrings consistent with dbprocessing style
[X] (N/A) Major new functionality has appropriate Sphinx documentation
[X] (N/A) Added an entry to release notes if fixing a major bug or providing a major new feature
[X] (see below) New features and bug fixes should have unit tests
[X] Relevant issues are linked in the description (use Closes # if this PR closes the issue, or some other reference, such as See # if it is related in some other way)
We don't yet have unit tests to make sure warnings aren't raised, and I didn't add them. But the tests now pass without warnings on Python 3.10 and sqlalchemy 1.4.
This PR fixes deprecations for Python 3.9 (some of which would be errors in 3.10) and for sqlalchemy 1.4. Maintains support on earlier Python and sqlalchemy. Closes #83.
For Python 3.9/3.10:
collections.abc
if possible (fallback tocollections
)is
string comparisons with==
For sqlalchemy 1.4:
table_names()
was removed (affects tests only)mapped_table
was replaced withpersist_selectable
(affects tests only)DButils
)newestVersionProblemFinder
, which is untested)This supersedes #84, which does not fix all warnings in #83 and didn't preserve namespacing on
collections
.PR Checklist
Closes #
if this PR closes the issue, or some other reference, such asSee #
if it is related in some other way)We don't yet have unit tests to make sure warnings aren't raised, and I didn't add them. But the tests now pass without warnings on Python 3.10 and sqlalchemy 1.4.