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

Fix: Align model with allowed values in backend #122

Merged
merged 2 commits into from
Aug 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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