Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve types of as_sql() and as_<engine>() methods #1315

Merged
merged 4 commits into from
Jan 25, 2023

Conversation

intgr
Copy link
Collaborator

@intgr intgr commented Jan 9, 2023

Related issues

Noticed this in #1243.

@intgr intgr force-pushed the fix-as_sql-and-as_engine branch from f860731 to 625a94a Compare January 9, 2023 11:26
class PostgreSQLSHAMixin:
def as_postgresql(
self, compiler: SQLCompiler, connection: BaseDatabaseWrapper, **extra_content: Any
self, compiler: SQLCompiler, connection: BaseDatabaseWrapper, **extra_context: Any
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Damn. That was my typo 😂 Thanks for fixing!

@intgr intgr marked this pull request as ready for review January 9, 2023 12:39
@intgr
Copy link
Collaborator Author

intgr commented Jan 25, 2023

This has been sitting for two weeks with no feedback. @ngnpope do you have time to do a review?

Copy link
Contributor

@ngnpope ngnpope left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

One that you've missed though:

django-stubs/contrib/gis/db/backends/utils.pyi:    def as_sql(self, connection: Any, lookup: Any, template_params: Any, sql_params: Any) -> _AsSqlType: ...

@intgr intgr force-pushed the fix-as_sql-and-as_engine branch from 3fd97c6 to 1b320cc Compare January 25, 2023 13:20
@intgr
Copy link
Collaborator Author

intgr commented Jan 25, 2023

Rebased and typehinted SpatialOperator.as_sql as well. This one has a very different signature from the others, needed some reverse engineering.

@intgr
Copy link
Collaborator Author

intgr commented Jan 25, 2023

Also fixed a failure detected by mypy-self-check, not sure why I didn't notice before.

@ngnpope
Copy link
Contributor

ngnpope commented Jan 25, 2023

Also fixed a failure detected by mypy-self-check, not sure why I didn't notice before.

#1315 (comment) 😉

@intgr intgr merged commit 32e5ebc into typeddjango:master Jan 25, 2023
@intgr intgr deleted the fix-as_sql-and-as_engine branch January 25, 2023 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants