Skip to content

Commit

Permalink
[FIX] add encoding in json.dumps
Browse files Browse the repository at this point in the history
  • Loading branch information
archetipo committed Feb 4, 2025
1 parent 04d8be0 commit 00a1398
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions ozonenv/core/OzonModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ async def load_raw(self, domain: dict) -> Union[None, dict]:
return {}
if data.get("_id"):
data.pop("_id")
return json.loads(json.dumps(data, cls=JsonEncoder))
return json.loads(json.dumps(data, cls=JsonEncoder, ensure_ascii=False))

async def find(
self, domain: dict, sort: str = "", limit=0, skip=0, pipeline_items=[]
Expand All @@ -743,7 +743,8 @@ async def find(
res = []
if datas:
for rec_dat in datas:
rec_data = json.loads(json.dumps(rec_dat, cls=JsonEncoder))
rec_data = json.loads(
json.dumps(rec_dat, cls=JsonEncoder, ensure_ascii=False))
if "_id" in rec_data:
rec_data['id'] = rec_data.pop("_id")
if self.virtual:
Expand Down Expand Up @@ -822,7 +823,8 @@ async def aggregate(
)
res = []
for rec_dat in datas:
rec_data = json.loads(json.dumps(rec_dat, cls=JsonEncoder))
rec_data = json.loads(
json.dumps(rec_dat, cls=JsonEncoder), ensure_ascii=False)
agg_mm = ModelMaker(f"{self.data_model}.agg")
if "_id" in rec_data:
rec_data['id'] = rec_data.pop("_id")
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 = "ozon-env"
version = "2.2.21"
version = "2.2.22"
homepage = "https://github.com/archetipo/ozon-env"
description = "Ozon Env API"
readme = "README.md"
Expand Down

0 comments on commit 00a1398

Please sign in to comment.