Skip to content

Commit

Permalink
Merge pull request #29 from mohamadkhalaj/main
Browse files Browse the repository at this point in the history
Remove walrus
  • Loading branch information
mohamadkhalaj authored Nov 1, 2023
2 parents 164e6e1 + 2731f84 commit 5e77408
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion aggify/aggify.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def last_out_stage_check(method):
@functools.wraps(method)
def decorator(*args, **kwargs):
try:
if last_is_out := bool(args[0].pipelines[-1].get("$out")):
if bool(args[0].pipelines[-1].get("$out")):
raise OutStageError(method.__name__)
except IndexError:
return method(*args, **kwargs)
Expand Down
3 changes: 2 additions & 1 deletion aggify/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,8 @@ def __init__(self, matches: dict[str, Any], base_model: Type[Document] | None):

@staticmethod
def validate_operator(key: str):
if (operator := key.rsplit("__", 1)[1]) not in Operators.COMPARISON_OPERATORS:
operator = key.rsplit("__", 1)[1]
if operator not in Operators.COMPARISON_OPERATORS:
raise InvalidOperator(operator)

def is_base_model_field(self, field) -> bool:
Expand Down

0 comments on commit 5e77408

Please sign in to comment.