Skip to content

Commit bfeee65

Browse files
committed
fixed type error
1 parent 654d207 commit bfeee65

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

filexdb/collection.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def __find_one(self, query: Mapping = None) -> Document | None:
133133
return _result
134134
"""
135135

136-
def find(self, query: Mapping = None, limit: tuple = None) -> List[Document | None]:
136+
def find(self, query=None, limit=None) -> List[Document]:
137137
"""
138138
Finds all ``Document`` of ``Collection``.
139139
@@ -175,7 +175,8 @@ def find(self, query: Mapping = None, limit: tuple = None) -> List[Document | No
175175

176176
# check if lower limit is valid or not
177177
if _limit_start >= len(self._collection):
178-
raise ValueError(f"Lower limit should be smaller than Collection length.\n It must be less than `{len(self._collection)}`. `{_limit_start}` is given.")
178+
raise ValueError(
179+
f"Lower limit should be smaller than Collection length.\n It must be less than `{len(self._collection)}`. `{_limit_start}` is given.")
179180
else:
180181
_result = self._collection[_limit_start: _limit_end]
181182
else:
@@ -212,6 +213,9 @@ def find(self, query: Mapping = None, limit: tuple = None) -> List[Document | No
212213

213214
if _doc:
214215
_result += _doc
216+
else:
217+
_result = _result
218+
215219
self._reset_cursor()
216220

217221
return _result
@@ -277,7 +281,6 @@ def update(self, document: Mapping, query: Mapping = None) -> List[str]:
277281

278282
return _doc_id
279283

280-
281284
def count(self, query: Mapping = None, limit: tuple = None) -> int:
282285
"""
283286
Return amount of Document found.

0 commit comments

Comments
 (0)