Skip to content

Commit

Permalink
fix numpy array incompatability (#658)
Browse files Browse the repository at this point in the history
* fix numpy array incompatibility

* rework numpy array check

* version: 1.22.4

---------

Co-authored-by: Roman <roman-right@protonmail.com>
  • Loading branch information
riven314 and roman-right committed Sep 14, 2023
1 parent 3b9c616 commit 19e5ade
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion beanie/__init__.py
Expand Up @@ -31,7 +31,7 @@
from beanie.odm.views import View
from beanie.odm.union_doc import UnionDoc

__version__ = "1.22.3"
__version__ = "1.22.4"
__all__ = [
# ODM
"Document",
Expand Down
3 changes: 2 additions & 1 deletion beanie/odm/utils/encoder.py
Expand Up @@ -156,7 +156,8 @@ def encode_document(self, obj):
else:
obj_dict[k] = o

if obj_dict[k] == IGNORE:
if isinstance(obj_dict[k], Ignore) and obj_dict[k] == IGNORE:
# Check the class, as direct comparison might not work, like with numpy arrays
del obj_dict[k]
else:
obj_dict[k] = encoder.encode(obj_dict[k])
Expand Down
8 changes: 8 additions & 0 deletions docs/changelog.md
Expand Up @@ -2,6 +2,14 @@

Beanie project

## [1.22.4] - 2023-09-13
### Fix Numpy Array Incompatability
- Author - [Alex Lau](https://github.com/riven314)
- PR <https://github.com/roman-right/beanie/pull/658>

[1.22.4]: https://pypi.org/project/beanie/1.22.4

## [1.22.3] - 2023-09-13
### Refactor: Simplify UpdateMany And UpdateOne __await__ Method
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Expand Up @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi"

[project]
name = "beanie"
version = "1.22.3"
version = "1.22.4"
description = "Asynchronous Python ODM for MongoDB"
readme = "README.md"
requires-python = ">=3.7,<4.0"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_beanie.py
Expand Up @@ -2,4 +2,4 @@


def test_version():
assert __version__ == "1.22.3"
assert __version__ == "1.22.4"

0 comments on commit 19e5ade

Please sign in to comment.