triage icon indicating copy to clipboard operation
triage copied to clipboard

Look at updating SQLAlchemy to 1.4.x

Open shaycrk opened this issue 2 years ago • 1 comments

This may involve some considerable refactoring, especially of unit tests, but by way of documentation, here are a couple of notes to consider from discussion with @jtwalsh0 and @ecsalomon on slack:

  • 1.4 strongly encourages/demands transaction blocks. If you use ohio's pg_copy_to, it will create the table but not insert any data unless you add an extra context manager. e.g.
with engine.connect() as conn:
    with conn.begin():
        df.pg_copy_to(...)
  • connect().execute('sql here') either requires a text() wrapper around the sql or switch to exec_driver_sql to bind to parameters
  • The major changes we need to make for 1.4 are rewriting the test suite, which has several patterns for mocking the database contents, and sqlalchemy 1.4 did not like most of them, and the errors were state based -- which tests fail depend on which tests ran before 😬

shaycrk avatar May 19 '22 22:05 shaycrk

This also prevents triage from upgrading pandas beyond 1.3.5. 1.5.0 will be out soon, so we will continue to face challenges with dependency upgrades and adoption if we do not upgrade sqlalchemy

ecsalomon avatar May 20 '22 00:05 ecsalomon