Add typing overloads to Query.__getitem__ and AppenderQuery.__getitem__#13142
Add typing overloads to Query.__getitem__ and AppenderQuery.__getitem__#13142medovi40k wants to merge 6 commits intosqlalchemy:mainfrom
Conversation
sqla-tester
left a comment
There was a problem hiding this comment.
OK, this is sqla-tester setting up my work on behalf of zzzeek to try to get revision 5ae5675 of this pull request into gerrit so we can run tests and reviews and stuff
|
New Gerrit review created for change 5ae5675: https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/6609 |
|
hey there - can you try running: and fix the failures occurring? also for the pep8 fails (you can run these via thanks! |
|
Heeyy! |
sqla-tester
left a comment
There was a problem hiding this comment.
OK, this is sqla-tester setting up my work on behalf of zzzeek to try to get revision 9ba1f01 of this pull request into gerrit so we can run tests and reviews and stuff
|
Patchset 9ba1f01 added to existing Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/6609 |
|
Federico Caselli (CaselIT) wrote: recheck View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/6626 |
|
Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/6609 has been merged. Congratulations! :) |
|
Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/6626 has been merged. Congratulations! :) |
Fixes #13128 ### Description `Query.__getitem__` and `AppenderQuery.__getitem__` previously returned Union[_T, List[_T]] for all inputs, making the return type inaccurate. Added `@overload` signatures so that integer index returns _T and slice returns List[_T]. This pull request is: - [x] A documentation / typographical / small typing error fix - Good to go, no issue or tests are needed Closes: #13142 Pull-request: #13142 Pull-request-sha: 9ba1f01 Change-Id: Ib37ab63d3d844491c34cc5ccfc4efc1591a1878c (cherry picked from commit 8af25c2)
Fixes #13128
Description
Query.__getitem__andAppenderQuery.__getitem__previously returned Union[_T, List[_T]] for all inputs, making the return type inaccurate.Added
@overloadsignatures so that integer index returns _T and slice returns List[_T].This pull request is: