diff --git a/src/cpr_sdk/pipeline_general_models.py b/src/cpr_sdk/pipeline_general_models.py index 0eb552b..ad1b3b2 100644 --- a/src/cpr_sdk/pipeline_general_models.py +++ b/src/cpr_sdk/pipeline_general_models.py @@ -2,7 +2,7 @@ from enum import Enum from typing import Mapping, Any, List, Optional, Sequence, Union -from pydantic import BaseModel, field_validator, model_validator +from pydantic import BaseModel, field_validator Json = dict[str, Any] @@ -29,7 +29,7 @@ class BackendDocument(BaseModel): family_import_id: str family_slug: str publication_ts: datetime - date: Optional[str] = None # Set on import by a validator + date: Optional[str] = None # Deprecated source_url: Optional[str] = None download_url: Optional[str] = None corpus_import_id: Optional[str] = None @@ -45,20 +45,6 @@ class BackendDocument(BaseModel): metadata: Json - @model_validator(mode="after") - def convert_publication_ts_to_date(self): - """ - Convert publication_ts to a datetime string. - - This is necessary as OpenSearch expects a date object. - - TODO: remove when no longer using Opensearch - """ - - self.date = self.publication_ts.strftime("%d/%m/%Y") - - return self - @field_validator("type", mode="before") @classmethod def none_to_empty_string(cls, value): diff --git a/src/cpr_sdk/version.py b/src/cpr_sdk/version.py index 9f91e53..2457b77 100644 --- a/src/cpr_sdk/version.py +++ b/src/cpr_sdk/version.py @@ -1,6 +1,6 @@ _MAJOR = "1" _MINOR = "3" -_PATCH = "10" +_PATCH = "11" _SUFFIX = "" VERSION_SHORT = "{0}.{1}".format(_MAJOR, _MINOR)