Skip to content

Commit 5dce648

Browse files
chore(internal): avoid lint errors in pagination expressions
1 parent e3d4bfd commit 5dce648

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/finch/pagination.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ def next_page_info(self) -> Optional[PageInfo]:
138138
if self.paging is not None: # pyright: ignore[reportUnnecessaryComparison]
139139
if self.paging.offset is not None: # pyright: ignore[reportUnnecessaryComparison]
140140
offset = self.paging.offset
141+
if offset is None:
142+
return None # type: ignore[unreachable]
141143

142144
length = len(self._get_page_items())
143145
current_count = offset + length
@@ -173,6 +175,8 @@ def next_page_info(self) -> Optional[PageInfo]:
173175
if self.paging is not None: # pyright: ignore[reportUnnecessaryComparison]
174176
if self.paging.offset is not None: # pyright: ignore[reportUnnecessaryComparison]
175177
offset = self.paging.offset
178+
if offset is None:
179+
return None # type: ignore[unreachable]
176180

177181
length = len(self._get_page_items())
178182
current_count = offset + length
@@ -207,6 +211,8 @@ def next_page_info(self) -> Optional[PageInfo]:
207211
if self.paging is not None: # pyright: ignore[reportUnnecessaryComparison]
208212
if self.paging.offset is not None: # pyright: ignore[reportUnnecessaryComparison]
209213
offset = self.paging.offset
214+
if offset is None:
215+
return None # type: ignore[unreachable]
210216

211217
length = len(self._get_page_items())
212218
current_count = offset + length
@@ -241,6 +247,8 @@ def next_page_info(self) -> Optional[PageInfo]:
241247
if self.paging is not None: # pyright: ignore[reportUnnecessaryComparison]
242248
if self.paging.offset is not None: # pyright: ignore[reportUnnecessaryComparison]
243249
offset = self.paging.offset
250+
if offset is None:
251+
return None # type: ignore[unreachable]
244252

245253
length = len(self._get_page_items())
246254
current_count = offset + length

0 commit comments

Comments
 (0)