[all] SQLAlchemy 2.0 and coming ORM apocalypse

Clark Boylan cboylan at sapwetik.org
Fri Aug 13 18:33:08 UTC 2021


On Thu, Aug 12, 2021, at 4:47 PM, Mike Bayer wrote:
> didn't see the main docs linked so the story starts at SQLA's migration docs.
> 
> starting w/ 1.4 which has all of 2.0's internals ready to go:
> 
> https://docs.sqlalchemy.org/en/14/changelog/migration_14.html
> 
> then 2.0 which includes 1.x->2.0 migration notes:
> 
> https://docs.sqlalchemy.org/en/14/changelog/migration_20.html
> 
> we spent a lot of time trying to make this process smooth.  it has both 
> a few ideas from how py2->py3 worked (warnings mode) and also does some 
> things intentionally the opposite of how py2/3 did it (you can run a 
> codebase that is compatible with 1.4 and 2.0 at the same time).
> 
> 

Thank you for those docs. I used them yesterday to kickstart this process for Zuul.

One thing I ran into is that the Python docs on warnings filters [0] are completely wrong [1][2][3] about being able to use regular expressions there. At least for filters supplied via environment variables or command line flags. I suspect this is why the migration docs suggest you do an internal filter instead, but wanted to call this out if anyone else ends up spending far too much time trying to understand why this isn't working.

[0] https://docs.python.org/3/library/warnings.html#the-warnings-filter
[1] https://bugs.python.org/issue34624
[2] https://github.com/python/cpython/pull/9358
[3] https://github.com/python/cpython/commit/62ec638



More information about the openstack-discuss mailing list