Skip to content
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

.upsert() with hash_id throws error #84

Closed
simonw opened this issue Feb 7, 2020 · 0 comments
Closed

.upsert() with hash_id throws error #84

simonw opened this issue Feb 7, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@simonw
Copy link
Owner

simonw commented Feb 7, 2020

db[table_name].upsert_all(rows, hash_id="pk")

This throws an error: PrimaryKeyRequired('upsert() requires a pk')

The problem is, if you try this:

db[table_name].upsert_all(rows, hash_id="pk", pk="pk")

You get this error: AssertionError('Use either pk= or hash_id=')

hash_id= should imply that pk= that column.

@simonw simonw added the bug Something isn't working label Feb 7, 2020
@simonw simonw closed this as completed in 7c28a4d Feb 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant