You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think I'm going to leave this as intended behaviour. Or maybe passing multiple dictionaries to .upsert_all() with different numbers of keys should raise an error?
simonw
changed the title
.upsert_all() nulls out fields
.upsert_all() should error if dictionaries passed to it do not have the same keys
Apr 13, 2020
Bit trick from an implementation point of view this, since we want to be able to handle input that is a generator - so we can't scan through the input to validate that every dictionary has the same exact keys without consuming the entire iterator.
The alternative would be to raise an error the first time we spot a dictionary with keys that differ... but that's weird because we commit changes in batches, so we may end up only applying half of the changes before exiting with the error.
On that basis, I'm going to leave this as-is and mark this as wontfix.
simonw
changed the title
.upsert_all() should error if dictionaries passed to it do not have the same keys
.upsert_all() should maybe error if dictionaries passed to it do not have the same keys
Apr 13, 2020
While investigating #98 I stumbled across this:
If you run
.upsert_all()
with multiple dictionaries it doesn't quite have the effect you might expect.The text was updated successfully, but these errors were encountered: