Skip to content

Commit

Permalink
fix: align model with allowed values in backend (#122)
Browse files Browse the repository at this point in the history
Signed-off-by: Michele Dolfi <97102151+dolfim-ibm@users.noreply.github.com>
  • Loading branch information
dolfim-ibm authored Aug 7, 2023
1 parent 20d8198 commit 0491ed4
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions deepsearch/documents/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,13 @@ class S3Coordinates(BaseModel):
class DocumentExistsInTargetAction(str, Enum):
"""
What to do if the document already exists on the target.
- `replace` will replace the document, destroying any external modifications.
- `merge` will try to merge the updated contents with the already-present document.
- `skip` will not touch the document on the target, leaving it as-is.
Using `skip` will incur in a performance increase, however, if the document
is modified externally, CCS will not update it back to the original state.
"""

REPLACE = "replace"
MERGE = "merge"
SKIP = "skip"


Expand All @@ -98,7 +94,7 @@ class MongoS3Target(BaseModel):
coordinates: MongoS3TargetCoordinates

if_document_exists: DocumentExistsInTargetAction = (
DocumentExistsInTargetAction.MERGE
DocumentExistsInTargetAction.REPLACE
)


Expand Down Expand Up @@ -141,7 +137,7 @@ class ElasticS3Target(BaseModel):
coordinates: ElasticS3TargetCoordinates

if_document_exists: DocumentExistsInTargetAction = (
DocumentExistsInTargetAction.MERGE
DocumentExistsInTargetAction.REPLACE
)

add_cells: bool = False
Expand Down

0 comments on commit 0491ed4

Please sign in to comment.