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

5.0: Update django.db.models.sql.compiler #2166

Merged
merged 2 commits into from
May 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion django-stubs/db/models/sql/compiler.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ from uuid import UUID
from django.db.backends.base.base import BaseDatabaseWrapper
from django.db.backends.utils import CursorWrapper
from django.db.models.base import Model
from django.db.models.expressions import BaseExpression, Expression
from django.db.models.expressions import BaseExpression, Expression, Ref
from django.db.models.sql.query import Query
from django.db.models.sql.subqueries import AggregateQuery, DeleteQuery, InsertQuery, UpdateQuery
from django.utils.functional import cached_property
Expand All @@ -18,6 +18,10 @@ _ParamT: TypeAlias = str | int
_ParamsT: TypeAlias = list[_ParamT]
_AsSqlType: TypeAlias = tuple[str, _ParamsT]

class PositionRef(Ref):
def __init__(self, ordinal: str, refs: str, source: Expression) -> None: ...
def as_sql(self, compiler: SQLCompiler, connection: BaseDatabaseWrapper) -> _AsSqlType: ...
Copy link
Member

Choose a reason for hiding this comment

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

as_sql exists here:

def as_sql(self, compiler: SQLCompiler, connection: BaseDatabaseWrapper) -> _AsSqlType: ...

Ref is a subclass of BaseExpression

JaeHyuckSa marked this conversation as resolved.
Show resolved Hide resolved

class SQLCompiler:
query: Query
connection: BaseDatabaseWrapper
Expand Down
1 change: 0 additions & 1 deletion scripts/stubtest/allowlist_todo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1231,7 +1231,6 @@ django.db.models.sql.Query.names_to_path
django.db.models.sql.Query.solve_lookup_type
django.db.models.sql.Query.table_alias
django.db.models.sql.XOR
django.db.models.sql.compiler.PositionRef
django.db.models.sql.compiler.SQLCompiler.__init__
django.db.models.sql.compiler.SQLCompiler.deferred_to_columns
django.db.models.sql.compiler.SQLCompiler.get_default_columns
Expand Down
Loading