Skip to content

Ensure bulk_upsert always returns an iterable #79

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

Conversation

xavierdutreilh
Copy link
Contributor

The return value of bulk_upsert is not consistent. Usually, it returns a list of dict. However, the sanity check added in c6686f1 makes sure that bulk_upsert returns None when no rows (or an empty list of rows) have been passed.

As a result, this pull request intends to change that by returning an empty list when the sanity check bypasses the rest of the code.

@Photonios Photonios merged commit 3c7cc29 into SectorLabs:master May 22, 2019
@Photonios
Copy link
Member

Many thanks for the contribution! Much appreciated 👍

@Photonios
Copy link
Member

I've released a new version on PyPi containing this fix and #78:

https://pypi.org/project/django-postgres-extra/1.21a17/
https://github.com/SectorLabs/django-postgres-extra/releases/tag/v1.21a17

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