ThibTrip / pangres

SQL upsert using pandas DataFrames for PostgreSQL, SQlite and MySQL with extra features
The Unlicense
229 stars 15 forks source link

sqlalchemy 2 Connectable #66

Closed ryw closed 1 year ago

ryw commented 1 year ago

Got an error on this line if using sqlalchemy 2 (just released) - pinning sqlalchemy to 1.4.45 resolved.

https://github.com/ThibTrip/pangres/blob/5856c6a615d161be5f55c84e804b1108679b1f58/pangres/core.py#L9

ThibTrip commented 1 year ago

Hi @ryw , sorry yes I naively thought this would work out of the box. IIRC I made changes a while ago in preparation for it using the future=True flag.

I started today but it is already very late :owl: . I'll continue tomorrow evening. Hopefully we can get this fixed quickly. I've used sqlalchemy==2.0 a tiny bit and it seems really great, especially for typing :hugs: .

ThibTrip commented 1 year ago

Hi @ryw, sorry for the delay, after you upgrade to the latest version, you should be able to use sqlalchemy2.

I wanted to test all possible environments and struggled to do so. I ended up executing a GitHub action locally with act and matrix for testing the different versions of Python (3.6 -> 3.11) and sqlalchemy (1.3.24, 1.4.46 and 2.0.1).

It took some time to research how to get it to work and I never found a way to run the tests (about 15 in total) in parallel. I'll have to come up with a way to create individual databases for each matrix run for both PostgreSQL and MySQL. But I am quite busy atm.