Skip to content

Commit

Permalink
fix: Use correct typing for find_one_by_id
Browse files Browse the repository at this point in the history
  • Loading branch information
jefersondaniel committed Jan 24, 2023
1 parent 1902578 commit 57210d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pydantic_mongo/abstract_repository.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Dict, Optional, Iterable, Sequence, Type, Tuple, TypeVar, Generic
from typing import Any, Dict, Optional, Iterable, Sequence, Type, Tuple, TypeVar, Generic
from pydantic import BaseModel
from .pagination import Edge, encode_pagination_cursor, decode_pagination_cursor, get_pagination_cursor_payload

Expand Down Expand Up @@ -77,7 +77,7 @@ def delete(self, model: T):
def find_one_by_id(self, id: str) -> Optional[T]:
return self.find_one_by({'id': id})

def find_one_by(self, query: dict) -> Optional[T]:
def find_one_by(self, query: Any) -> Optional[T]:
result = self.get_collection().find_one(self.__map_id(query))
return self.to_model(result) if result else None

Expand Down

0 comments on commit 57210d6

Please sign in to comment.