fix(api): add bulk_upsert method and unit tests for opensearch BaseOSDB class - #990
fix(api): add bulk_upsert method and unit tests for opensearch BaseOSDB class#990vkuznet wants to merge 3 commits into
Conversation
| raise_on_error=False, | ||
| raise_on_exception=False, |
There was a problem hiding this comment.
What is the rationale for this?
There was a problem hiding this comment.
According to aysnc_bulk documentation
... Note that by default we raise a
BulkIndexErrorwhen we encounter an error so options likestats_onlyonly+ apply whenraise_on_erroris set toFalse.
So, it is question of policy regarding errors which I frankly don't know.
There was a problem hiding this comment.
In https://github.com/DIRACGrid/diracx/pull/1007/changes#r3734978424 @aldbr added a DocumentUpsertError exception which I believe could be used here too
There was a problem hiding this comment.
@fstagni since this PR is not yet merged and I can't yet use in my PR. Do you want me to wait until it is merged or use a different exception?
@fstagni regarding issue #401. I checked the main repository code and what is described in this issue is not there the issue is based on commit outside of any branch, most likely in fork outside of the repository diracx/diracx-routers/src/diracx/routers/jobs/status.py Lines 174 to 180 in 7c260cc |
|
Hi, since #410 was created, the mentioned code has been moved and refactored, and can now be found in https://github.com/DIRACGrid/diracx/blob/main/diracx-logic/src/diracx/logic/jobs/status.py#L643. The issue anyway still holds, can you have a look? |
This PR fixes issue #401 by introducing the
bulk_upsertAPI to BaseOSDB class. It is also complement by full set of unit tests for BaseOSDB class which were missing. The unit test introduces mock client and different classes for different use cases.Please note: it is my first PR and I'm happy to adjust it according to requirements/guidelines of DiracX community.