Repository navigation
Fix Any overloads for inspect() raiseerr handling - #13710
princejain756 wants to merge 3 commits into
Conversation
|
Thanks! Issue #13704 is now marked code review in progress and no longer open for pull requests, so this pull request holds the review for it and another one won't land on top of your work. If this pull request is abandoned, a maintainer can put open for pull requests back on #13704 to reopen it to others. |
|
thanks, looks ok! |
sqla-tester
left a comment
There was a problem hiding this comment.
OK, this is sqla-tester setting up my work on behalf of CaselIT to try to get revision 1078553 of this pull request into gerrit so we can run tests and reviews and stuff
|
New Gerrit review created for change 1078553: https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/7122 |
sqla-tester
left a comment
There was a problem hiding this comment.
Michael Bayer (zzzeek) wrote:
need to remove that comment, otherwise looks good
View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/7122
sqla-tester
left a comment
There was a problem hiding this comment.
OK, this is sqla-tester setting up my work on behalf of CaselIT to try to get revision c5097c9 of this pull request into gerrit so we can run tests and reviews and stuff
|
Patchset c5097c9 added to existing Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/7122 |
sqla-tester
left a comment
There was a problem hiding this comment.
Michael Bayer (zzzeek) wrote:
Code-Review+2 Workflow+2
(1 comment)
View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/7122
| # inspect(), it should not have None as an option in most cases | ||
| # if at all | ||
| insp: InspectionAttr = inspect(attr) # type: ignore[assignment] | ||
| insp: InspectionAttr = inspect(attr) |
There was a problem hiding this comment.
Michael Bayer (zzzeek) wrote:
Done
View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/7122
|
Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/7122 has been merged. Congratulations! :) |
Fixes
Fixes: #13704
Description
Update the fallback
@overloadsignatures forinspect(subject: Any, ...)inlib/sqlalchemy/inspection.pyso the defaultraiseerr: Literal[True] = ... -> Anyoverload precedesraiseerr: bool -> Optional[Any]:inspect(obj)withraiseerromitted orTruenow resolves toAnyinstead ofAny | None.inspect(obj, raiseerr=flag)withFalseor aboolvariable now resolves toOptional[Any](Any | None).test/typing/plain_files/inspection_inspect.pyto cover omittedraiseerr, literal booleans, and aboolparameter on aProtocol-typed subject.