Skip to content

fix update_many with new columns #436

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fix update_many with new columns #436

wants to merge 1 commit into from

Conversation

medecau
Copy link

@medecau medecau commented Jan 29, 2025

fixes a bug where updating many records with new columns and ensuring those columns are created would raise a sqlalchemy.exc.CompileError exception as reported in #409

the pull request includes two new unit-tests:

  1. ensure the bug is fixed
  2. demonstrate the behaviour when new columns are present but the ensure argument is set to False

in making these changes i did not consider the cases under point 2, i'm uncertain what the right behaviour should be under those circumstances

as stated by @4l1fe in #409 this solution may work on other methods

a way to improve the insert_many(), upsert_many(), update_many() methods is to add a new wrapper _sync_columns_many()

i wouldn't mind working on this if there is some indication the work will get merged
ping @pudo, @gka

@gka
Copy link
Collaborator

gka commented Feb 5, 2025

Hi @medecau and thanks a lot for your contribution. It's been a while since I last worked on this project, but I'll see if I can get @pudo's attention somehow!

@medecau
Copy link
Author

medecau commented Feb 7, 2025

thanks @gka
pinged you because i noticed your handle on pypi's page for dataset

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants