Skip to content

Commit

Permalink
[FIX] Deprecation warinig The method is deprecated; use
Browse files Browse the repository at this point in the history
  • Loading branch information
archetipo committed Aug 8, 2023
1 parent b5d3a49 commit 99b3145
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions ozonenv/core/OzonOrm.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,11 +451,9 @@ def _getattribute(obj, name):
self.orm_static_models_map[model_name] = model

async def make_local_model(self, mod, version):
jdata = mod.mm.model.schema_json(indent=2)
# TODO but generator rise exception in asyncfile
# jdata = mod.mm.model.model_json_schema()
jdata = mod.mm.model.model_json_schema()
async with aiofiles.open(f"/tmp/{mod.name}.json", "w+") as mod_file:
await mod_file.write(jdata)
await mod_file.write(json.dumps(jdata))
res = await self.runcmd(
f"datamodel-codegen --input /tmp/{mod.name}.json"
f" --output {self.models_path}/{mod.name}.py "
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.1.11"
version = "2.1.12"
homepage = "https://github.com/archetipo/ozon-env"
description = "Ozon Env API"
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_ozon_env_5_basic_for_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ async def process_document(self, data_doc) -> CoreModel:
row_o = await self.virtual_row_doc_model.new(
rec_name=f"{v_doc.rec_name}.{row.nrRiga}",
data=row_dictr.data.copy(),
fields_parser={"code": {"type": "string"}}
fields_parser={"code": {"type": "string"}},
)
row_o.parent = v_doc.rec_name
assert row_o.nrRiga == row.nrRiga
Expand Down

0 comments on commit 99b3145

Please sign in to comment.