Skip to content

Commit

Permalink
not sure this is actually a good idea
Browse files Browse the repository at this point in the history
  • Loading branch information
liviuba committed Dec 3, 2024
1 parent f29a39c commit fb084c8
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions api/api/models/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,6 @@ def transform_bson(self, value: DatetimeMS) -> datetime.date:
return value.as_datetime().date()


class AnyUrlCodec(TypeCodec):
python_type = AnyUrl
bson_type = str

def transform_python(self, value: AnyUrl) -> str:
return str(value)

def transform_bson(self, value: str) -> str:
return value


class OverwriteMode(str, Enum):
FAIL = "fail"
ALLOW_IDEMPOTENT = "allow_idempotent"
Expand Down Expand Up @@ -88,7 +77,7 @@ def configure(self, settings: Settings):
# Looks like explicitly setting codec_options excludes settings from the client
# so uuid_representation needs to be defined even if already defined in connection
codec_options=CodecOptions(
type_registry=TypeRegistry([DateCodec(), AnyUrlCodec()]),
type_registry=TypeRegistry([DateCodec()], fallback_encoder=str),
uuid_representation=UuidRepresentation.STANDARD,
),
)
Expand Down

0 comments on commit fb084c8

Please sign in to comment.