Skip to content

Commit

Permalink
Update allowlist and remove unused ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
UnknownPlatypus committed Nov 7, 2023
1 parent 942ce32 commit 58aa39c
Show file tree
Hide file tree
Showing 16 changed files with 70 additions and 67 deletions.
40 changes: 20 additions & 20 deletions django-stubs/contrib/gis/db/models/functions.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -35,37 +35,37 @@ class Area(OracleToleranceMixin, GeoFunc):
def as_sqlite(self, compiler: SQLCompiler, connection: BaseDatabaseWrapper, **extra_context: Any) -> _AsSqlType: ...

class Azimuth(GeoFunc):
output_field: ClassVar[FloatField] # type: ignore[assignment]
output_field: ClassVar[FloatField]
arity: int
geom_param_pos: Any

class AsGeoJSON(GeoFunc):
output_field: ClassVar[TextField] # type: ignore[assignment]
output_field: ClassVar[TextField]
def __init__(
self, expression: Any, bbox: bool = ..., crs: bool = ..., precision: int = ..., **extra: Any
) -> None: ...
def as_oracle(self, compiler: SQLCompiler, connection: BaseDatabaseWrapper, **extra_context: Any) -> _AsSqlType: ...

class AsGML(GeoFunc):
geom_param_pos: Any
output_field: ClassVar[TextField] # type: ignore[assignment]
output_field: ClassVar[TextField]
def __init__(self, expression: Any, version: int = ..., precision: int = ..., **extra: Any) -> None: ...
def as_oracle(self, compiler: SQLCompiler, connection: BaseDatabaseWrapper, **extra_context: Any) -> _AsSqlType: ...

class AsKML(GeoFunc):
output_field: ClassVar[TextField] # type: ignore[assignment]
output_field: ClassVar[TextField]
def __init__(self, expression: Any, precision: int = ..., **extra: Any) -> None: ...

class AsSVG(GeoFunc):
output_field: ClassVar[TextField] # type: ignore[assignment]
output_field: ClassVar[TextField]
def __init__(self, expression: Any, relative: bool = ..., precision: int = ..., **extra: Any) -> None: ...

class AsWKB(GeoFunc):
output_field: ClassVar[BinaryField] # type: ignore[assignment]
output_field: ClassVar[BinaryField]
arity: int

class AsWKT(GeoFunc):
output_field: ClassVar[TextField] # type: ignore[assignment]
output_field: ClassVar[TextField]
arity: int

class BoundingCircle(OracleToleranceMixin, GeomOutputGeoFunc):
Expand All @@ -84,7 +84,7 @@ class DistanceResultMixin:
def output_field(self) -> DistanceField: ...
def source_is_geography(self) -> Any: ...

class Distance(DistanceResultMixin, OracleToleranceMixin, GeoFunc): # type: ignore[misc]
class Distance(DistanceResultMixin, OracleToleranceMixin, GeoFunc):
geom_param_pos: Any
spheroid: Any
def __init__(self, expr1: Any, expr2: Any, spheroid: Any | None = ..., **extra: Any) -> None: ...
Expand All @@ -100,20 +100,20 @@ class ForcePolygonCW(GeomOutputGeoFunc):
arity: int

class FromWKB(GeoFunc):
output_field: ClassVar[GeometryField] # type: ignore[assignment]
output_field: ClassVar[GeometryField]
arity: int

class FromWKT(GeoFunc):
output_field: ClassVar[GeometryField] # type: ignore[assignment]
output_field: ClassVar[GeometryField]
arity: int

class GeoHash(GeoFunc):
output_field: ClassVar[TextField] # type: ignore[assignment]
output_field: ClassVar[TextField]
def __init__(self, expression: Any, precision: Any | None = ..., **extra: Any) -> None: ...
def as_mysql(self, compiler: SQLCompiler, connection: BaseDatabaseWrapper, **extra_context: Any) -> _AsSqlType: ...

class GeometryDistance(GeoFunc):
output_field: ClassVar[FloatField] # type: ignore[assignment]
output_field: ClassVar[FloatField]
arity: int
function: str
arg_joiner: str
Expand All @@ -125,14 +125,14 @@ class Intersection(OracleToleranceMixin, GeomOutputGeoFunc):

class IsEmpty(GeoFuncMixin, StandardTransform):
lookup_name: str
output_field: ClassVar[BooleanField] # type: ignore[assignment]
output_field: ClassVar[BooleanField]

class IsValid(OracleToleranceMixin, GeoFuncMixin, StandardTransform):
lookup_name: str
output_field: ClassVar[BooleanField] # type: ignore[assignment]
output_field: ClassVar[BooleanField]
def as_oracle(self, compiler: SQLCompiler, connection: BaseDatabaseWrapper, **extra_context: Any) -> _AsSqlType: ...

class Length(DistanceResultMixin, OracleToleranceMixin, GeoFunc): # type: ignore[misc]
class Length(DistanceResultMixin, OracleToleranceMixin, GeoFunc):
spheroid: Any
def __init__(self, expr1: Any, spheroid: bool = ..., **extra: Any) -> None: ...
def as_postgresql(
Expand All @@ -141,25 +141,25 @@ class Length(DistanceResultMixin, OracleToleranceMixin, GeoFunc): # type: ignor
def as_sqlite(self, compiler: SQLCompiler, connection: BaseDatabaseWrapper, **extra_context: Any) -> _AsSqlType: ...

class LineLocatePoint(GeoFunc):
output_field: ClassVar[FloatField] # type: ignore[assignment]
output_field: ClassVar[FloatField]
arity: int
geom_param_pos: Any

class MakeValid(GeomOutputGeoFunc): ...

class MemSize(GeoFunc):
output_field: ClassVar[IntegerField] # type: ignore[assignment]
output_field: ClassVar[IntegerField]
arity: int

class NumGeometries(GeoFunc):
output_field: ClassVar[IntegerField] # type: ignore[assignment]
output_field: ClassVar[IntegerField]
arity: int

class NumPoints(GeoFunc):
output_field: ClassVar[IntegerField] # type: ignore[assignment]
output_field: ClassVar[IntegerField]
arity: int

class Perimeter(DistanceResultMixin, OracleToleranceMixin, GeoFunc): # type: ignore[misc]
class Perimeter(DistanceResultMixin, OracleToleranceMixin, GeoFunc):
arity: int
def as_postgresql(
self, compiler: SQLCompiler, connection: BaseDatabaseWrapper, **extra_context: Any
Expand Down
10 changes: 5 additions & 5 deletions django-stubs/contrib/postgres/aggregates/general.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ from .mixins import OrderableAggMixin

class ArrayAgg(OrderableAggMixin, Aggregate):
@property
def output_field(self) -> ArrayField: ... # type: ignore[override]
def output_field(self) -> ArrayField: ...

class BitAnd(Aggregate): ...
class BitOr(Aggregate): ...

class BoolAnd(Aggregate):
output_field: ClassVar[BooleanField] # type: ignore[assignment]
output_field: ClassVar[BooleanField]

class BoolOr(Aggregate):
output_field: ClassVar[BooleanField] # type: ignore[assignment]
output_field: ClassVar[BooleanField]

class JSONBAgg(OrderableAggMixin, Aggregate):
output_field: ClassVar[JSONField] # type: ignore[assignment]
output_field: ClassVar[JSONField]

class StringAgg(OrderableAggMixin, Aggregate):
output_field: ClassVar[TextField] # type: ignore[assignment]
output_field: ClassVar[TextField]
2 changes: 1 addition & 1 deletion django-stubs/contrib/postgres/aggregates/statistics.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ from typing import ClassVar
from django.db.models import Aggregate, FloatField, IntegerField

class StatAggregate(Aggregate):
output_field: ClassVar[FloatField] # type: ignore[assignment]
output_field: ClassVar[FloatField]

class Corr(StatAggregate): ...
class CovarPop(StatAggregate): ...
Expand Down
6 changes: 3 additions & 3 deletions django-stubs/contrib/postgres/fields/hstore.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class HStoreField(CheckFieldDefaultMixin, Field):
def get_transform(self, name: str) -> Any: ...

class KeyTransform(Transform):
output_field: ClassVar[TextField] # type: ignore[assignment]
output_field: ClassVar[TextField]

def __init__(self, key_name: str, *args: Any, **kwargs: Any) -> None: ...

Expand All @@ -17,7 +17,7 @@ class KeyTransformFactory:
def __call__(self, *args: Any, **kwargs: Any) -> KeyTransform: ...

class KeysTransform(Transform):
output_field: ClassVar[ArrayField] # type: ignore[assignment]
output_field: ClassVar[ArrayField]

class ValuesTransform(Transform):
output_field: ClassVar[ArrayField] # type: ignore[assignment]
output_field: ClassVar[ArrayField]
14 changes: 7 additions & 7 deletions django-stubs/contrib/postgres/fields/ranges.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,23 @@ class AdjacentToLookup(PostgresOperatorLookup): ...

class RangeStartsWith(models.Transform):
@property
def output_field(self) -> models.Field: ... # type: ignore[override]
def output_field(self) -> models.Field: ...

class RangeEndsWith(models.Transform):
@property
def output_field(self) -> models.Field: ... # type: ignore[override]
def output_field(self) -> models.Field: ...

class IsEmpty(models.Transform):
output_field: ClassVar[models.BooleanField] # type: ignore[assignment]
output_field: ClassVar[models.BooleanField]

class LowerInclusive(models.Transform):
output_field: ClassVar[models.BooleanField] # type: ignore[assignment]
output_field: ClassVar[models.BooleanField]

class LowerInfinite(models.Transform):
output_field: ClassVar[models.BooleanField] # type: ignore[assignment]
output_field: ClassVar[models.BooleanField]

class UpperInclusive(models.Transform):
output_field: ClassVar[models.BooleanField] # type: ignore[assignment]
output_field: ClassVar[models.BooleanField]

class UpperInfinite(models.Transform):
output_field: ClassVar[models.BooleanField] # type: ignore[assignment]
output_field: ClassVar[models.BooleanField]
4 changes: 2 additions & 2 deletions django-stubs/contrib/postgres/functions.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ from typing import ClassVar
from django.db.models import DateTimeField, Func, UUIDField

class RandomUUID(Func):
output_field: ClassVar[UUIDField] # type: ignore[assignment]
output_field: ClassVar[UUIDField]

class TransactionNow(Func):
output_field: ClassVar[DateTimeField] # type: ignore[assignment]
output_field: ClassVar[DateTimeField]
12 changes: 6 additions & 6 deletions django-stubs/contrib/postgres/search.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class SearchVector(SearchVectorCombinable, Func):
config: _Expression | None
function: str
arg_joiner: str
output_field: ClassVar[SearchVectorField] # type: ignore[assignment]
output_field: ClassVar[SearchVectorField]
def __init__(
self, *expressions: _Expression, config: _Expression | None = ..., weight: Any | None = ...
) -> None: ...
Expand All @@ -48,7 +48,7 @@ class SearchQueryCombinable:
def __rand__(self, other: SearchQueryCombinable) -> Self: ...

class SearchQuery(SearchQueryCombinable, Func): # type: ignore[misc]
output_field: ClassVar[SearchQueryField] # type: ignore[assignment]
output_field: ClassVar[SearchQueryField]
SEARCH_TYPES: dict[str, str]
def __init__(
self,
Expand All @@ -72,7 +72,7 @@ class CombinedSearchQuery(SearchQueryCombinable, CombinedExpression): # type: i
) -> None: ...

class SearchRank(Func):
output_field: ClassVar[FloatField] # type: ignore[assignment]
output_field: ClassVar[FloatField]
def __init__(
self,
vector: SearchVector | _Expression,
Expand All @@ -85,7 +85,7 @@ class SearchRank(Func):
class SearchHeadline(Func):
function: str
template: str
output_field: ClassVar[TextField] # type: ignore[assignment]
output_field: ClassVar[TextField]
def __init__(
self,
expression: _Expression,
Expand All @@ -103,11 +103,11 @@ class SearchHeadline(Func):
) -> None: ...

class TrigramBase(Func):
output_field: ClassVar[FloatField] # type: ignore[assignment]
output_field: ClassVar[FloatField]
def __init__(self, expression: _Expression, string: str, **extra: Any) -> None: ...

class TrigramWordBase(Func):
output_field: ClassVar[FloatField] # type: ignore[assignment]
output_field: ClassVar[FloatField]
def __init__(self, string: str, expression: _Expression, **extra: Any) -> None: ...

class TrigramSimilarity(TrigramBase): ...
Expand Down
2 changes: 1 addition & 1 deletion django-stubs/db/models/aggregates.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Aggregate(Func):
class Avg(FixDurationInputMixin, NumericOutputFieldMixin, Aggregate): ...

class Count(Aggregate):
output_field: ClassVar[IntegerField] # type: ignore[assignment]
output_field: ClassVar[IntegerField]

class Max(Aggregate): ...
class Min(Aggregate): ...
Expand Down
4 changes: 2 additions & 2 deletions django-stubs/db/models/expressions.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class DurationExpression(CombinedExpression):
def compile(self, side: Combinable, compiler: SQLCompiler, connection: BaseDatabaseWrapper) -> _AsSqlType: ...

class TemporalSubtraction(CombinedExpression):
output_field: ClassVar[fields.DurationField] # type: ignore[assignment]
output_field: ClassVar[fields.DurationField]
def __init__(self, lhs: Combinable, rhs: Combinable) -> None: ...

class F(_Deconstructible, Combinable):
Expand Down Expand Up @@ -242,7 +242,7 @@ class Subquery(BaseExpression, Combinable):
def __init__(self, queryset: Query | QuerySet, output_field: Field | None = ..., **extra: Any) -> None: ...

class Exists(Subquery):
output_field: ClassVar[fields.BooleanField] # type: ignore[assignment]
output_field: ClassVar[fields.BooleanField]
def __init__(self, queryset: Query | QuerySet, **kwargs: Any) -> None: ...

class OrderBy(Expression):
Expand Down
2 changes: 1 addition & 1 deletion django-stubs/db/models/fields/json.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class KeyTransform(Transform):
class KeyTextTransform(KeyTransform):
postgres_operator: str
postgres_nested_operator: str
output_field: ClassVar[TextField] # type: ignore[assignment]
output_field: ClassVar[TextField]
@classmethod
def from_lookup(cls, lookup: str) -> Self: ...

Expand Down
2 changes: 1 addition & 1 deletion django-stubs/db/models/functions/comparison.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Greatest(Func): ...

class JSONObject(Func):
def __init__(self, **fields: Any) -> None: ...
output_field: ClassVar[JSONField] # type: ignore[assignment]
output_field: ClassVar[JSONField]

class Least(Func): ...
class NullIf(Func): ...
8 changes: 4 additions & 4 deletions django-stubs/db/models/functions/datetime.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class TimezoneMixin:

class Extract(TimezoneMixin, Transform):
lookup_name: str
output_field: ClassVar[models.IntegerField] # type: ignore[assignment]
output_field: ClassVar[models.IntegerField]
def __init__(
self, expression: Any, lookup_name: str | None = ..., tzinfo: Any | None = ..., **extra: Any
) -> None: ...
Expand All @@ -27,7 +27,7 @@ class ExtractMinute(Extract): ...
class ExtractSecond(Extract): ...

class Now(Func):
output_field: ClassVar[models.DateTimeField] # type: ignore[assignment]
output_field: ClassVar[models.DateTimeField]

class TruncBase(TimezoneMixin, Transform):
kind: str
Expand All @@ -41,10 +41,10 @@ class TruncWeek(TruncBase): ...
class TruncDay(TruncBase): ...

class TruncDate(TruncBase):
output_field: ClassVar[models.DateField] # type: ignore[assignment]
output_field: ClassVar[models.DateField]

class TruncTime(TruncBase):
output_field: ClassVar[models.TimeField] # type: ignore[assignment]
output_field: ClassVar[models.TimeField]

class TruncHour(TruncBase): ...
class TruncMinute(TruncBase): ...
Expand Down
Loading

0 comments on commit 58aa39c

Please sign in to comment.