Skip to content

Commit

Permalink
do not use walrus operator in assert (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
malmans2 authored Nov 28, 2024
1 parent 2d9676d commit 9060af9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions datapi/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down

0 comments on commit 9060af9

Please sign in to comment.