transferwise / pipelinewise-target-redshift

Singer.io Target for Amazon Redshift - PipelineWise compatible
https://transferwise.github.io/pipelinewise/
Other
12 stars 65 forks source link

Support Python 3.10 and 3.11 #228

Closed menzenski closed 3 months ago

menzenski commented 1 year ago

Context

This PR is necessary because in Python 3.10 and above, MutableMapping cannot be imported from the collections package - it must be imported from collections.abc. Per the documentation:

Deprecated since version 3.3, will be removed in version 3.10: Moved Collections Abstract Base Classes to the collections.abc module. For backwards compatibility, they continue to be visible in this module through Python 3.9.

The collections.abc import is supported in earlier versions of Python as well. I've personally tested this change down to Python 3.7.

Checklist

^ I can't view that Baseline Security Requirements document, but I don't believe this PR has any negative impact on security.

jpuris commented 1 year ago

Looks like duplicate of #160

Someone smarter than me might want to chip on which version of the solution is more appropriate 🤷

craigastill commented 1 year ago

In absence of a Maintainer review (5 months at time of writing this), the backwards compatible import fix in #160 is cleaner. I would suggest to build off #160 and then apply your psycopg2 dependency update. Also might be worth bumping to the current version which looks to have python3.12 support from 3.1.3+ (https://github.com/psycopg/psycopg/issues/305).

There's currently no automated validation for the fix. My suggestion would be to add a python 3.11 CI job.