Skip to content

Commit

Permalink
Fix on MapperOptions to set extras as default empty dict
Browse files Browse the repository at this point in the history
  • Loading branch information
gurcuff91 committed May 20, 2024
1 parent 01419ae commit 31fd41d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions mongotoy/mappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ class MapperOptions:
default_factory (Callable[[], Any] | None): Factory function to generate default values. Defaults to None.
ref_field (str): Field name to use as a reference. Defaults to None.
key_name (str): Name of the key when using a reference. Defaults to None.
extra (dict): Extra options for customization. Defaults to None.
extra (dict): Extra options for customization. Defaults to empty dict.
"""
nullable: bool = dataclasses.field(default=False)
default: typing.Any = dataclasses.field(default=expressions.EmptyValue)
default_factory: typing.Callable[[], typing.Any] | None = dataclasses.field(default=None)
ref_field: str = dataclasses.field(default=None)
key_name: str = dataclasses.field(default=None)
extra: dict = dataclasses.field(default=None)
extra: dict = dataclasses.field(default_factory=dict)


def build_mapper(mapper_bind: typing.Type, options: MapperOptions) -> 'Mapper':
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "mongotoy"
version = "0.1.5"
version = "0.1.6"
description = "Comprehensive ODM for MongoDB"
license = "Apache-2.0"
authors = ["gurcuff91 <[email protected]>"]
Expand Down

0 comments on commit 31fd41d

Please sign in to comment.