uranusjr commented on code in PR #57532:
URL: https://github.com/apache/airflow/pull/57532#discussion_r2532432040
##########
airflow-core/src/airflow/utils/db.py:
##########
@@ -1638,9 +1639,9 @@ def __getitem__(self, key: slice) -> Sequence[T]: ...
def __getitem__(self, key: int | slice) -> T | Sequence[T]:
if isinstance(key, int):
if key >= 0:
- stmt = self._select_asc.offset(key)
+ stmt = cast("Select", self._select_asc).offset(key)
else:
- stmt = self._select_desc.offset(-1 - key)
+ stmt = cast("Select", self._select_desc).offset(-1 - key)
Review Comment:
I don’t think doing this cast repeatedly is a good idea. `_select_asc` and
`_select_desc` should keep their current annotation, and cast should just be
done when those values are set.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]