From 9060af9a09bd8dd52e2b86f019bdf9f2f5632060 Mon Sep 17 00:00:00 2001 From: Mattia Almansi Date: Thu, 28 Nov 2024 09:48:47 +0100 Subject: [PATCH] do not use walrus operator in assert (#6) --- datapi/processing.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/datapi/processing.py b/datapi/processing.py index c2059cc..7aa3c88 100644 --- a/datapi/processing.py +++ b/datapi/processing.py @@ -203,13 +203,15 @@ def json(self) -> Any: @property def _json_dict(self) -> dict[str, Any]: - assert isinstance(content := self.json, dict) - return content + json_dict = self.json + assert isinstance(json_dict, dict) + return json_dict @property def _json_list(self) -> list[dict[str, Any]]: - assert isinstance(content := self.json, list) - return content + json_list = self.json + assert isinstance(json_list, list) + return json_list def log_messages(self) -> None: if message_str := self._json_dict.get("message"):