Skip to content

Commit

Permalink
adjusted logical operators typing error BeanieODM#1000
Browse files Browse the repository at this point in the history
  • Loading branch information
janas-adam committed Sep 5, 2024
1 parent ca585b1 commit 47bda02
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions beanie/odm/operators/find/logical.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,19 @@ class BaseFindLogicalOperator(BaseFindOperator, ABC): ...


class LogicalOperatorForListOfExpressions(BaseFindLogicalOperator):
# todo: handle query return typing
operator: str = ""

def __init__(
self,
*expressions: Union[
BaseFindOperator, Dict[str, Any], Mapping[str, Any]
BaseFindOperator, Dict[str, Any], Mapping[str, Any], bool
],
):
self.expressions = list(expressions)

@property
def query(self) -> Mapping[str, Any]:
def query(self):
if not self.expressions:
raise AttributeError("At least one expression must be provided")
if len(self.expressions) == 1:
Expand Down

0 comments on commit 47bda02

Please sign in to comment.