-
Notifications
You must be signed in to change notification settings - Fork 959
apply coalesce to values being bulk-added to handle nulls #3354
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
augur/application/db/lib.py
Outdated
|
|
||
|
|
||
|
|
||
| def bulk_insert_dicts(logger, data: Union[List[dict], dict], table, natural_keys: List[str], return_columns: Optional[List[str]] = None, string_fields: Optional[List[str]] = None, on_conflict_update:bool = True) -> Optional[List[dict]]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[pylint] reported by reviewdog 🐶
W0621: Redefining name 'logger' from outer scope (line 19) (redefined-outer-name)
436b6d3 to
f4f0501
Compare
|
|
||
|
|
||
|
|
||
| def bulk_insert_dicts(logger, data_input: Union[List[dict], dict], table, natural_keys: List[str], return_columns: Optional[List[str]] = None, string_fields: Optional[List[str]] = None, on_conflict_update:bool = True) -> Optional[List[dict]]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[pylint] reported by reviewdog 🐶
W0621: Redefining name 'logger' from outer scope (line 19) (redefined-outer-name)
|
I did a quick smoke test and it looks like this PR fixes our problem with some commits, like UCL/rsd-engineeringcourse@fffaf9a, not being attributed to any user, as it's currently happening. |
|
Sweet! Since I made modifications since we wrote this and it impacts a critical part of the code, I'd like to get @ABrain7710's input on this before merging |
…pped Signed-off-by: Adrian Edwards <adredwar@redhat.com> Co-authored-by: Mahmoud Abdelrazek <44040283+razekmh@users.noreply.github.com> Co-authored-by: Andrew Brain <andrewbrain2019@gmail.com>
…bject as well. Co-Created by: gpt-5 via cursor Signed-off-by: Adrian Edwards <adredwar@redhat.com>
f4f0501 to
f5acdf5
Compare
sgoggins
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
A collaborative change built with the other augur maintainers (@sgoggins and @ABrain7710) to add the
coalescepostgres function to our bulk insert methods to ensure that values in the database cannot be overwritten with NULL values. This was inspired by @razekmh's solution in #3342This was implemented without a parameter to toggle this functionality off because we couldnt think of a scenario where one might want to intentionally overwrite data with null in augur
This PR fixes #3317
This supersedes #3342
Notes for Reviewers
should be all set to merge once the OP of the linked issue confirms this still fixes the issue.
Signed commits