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 Oct 25, 2023
1 parent eed3a1b commit 3ec21c8
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 6 deletions.
2 changes: 1 addition & 1 deletion django-stubs/db/backends/dummy/features.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.db.backends.base.features import BaseDatabaseFeatures

class DummyDatabaseFeatures(BaseDatabaseFeatures):
supports_transactions: bool # type: ignore[assignment]
supports_transactions: bool
uses_savepoints: bool
2 changes: 1 addition & 1 deletion django-stubs/db/backends/oracle/features.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
can_return_columns_from_insert: bool
can_introspect_autofield: bool
supports_subqueries_in_group_by: bool
supports_transactions: bool # type: ignore[assignment]
supports_transactions: bool
supports_timezones: bool
has_native_duration_field: bool
can_defer_constraint_checks: bool
Expand Down
2 changes: 1 addition & 1 deletion django-stubs/db/backends/postgresql/features.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
has_select_for_no_key_update: bool
can_release_savepoints: bool
supports_tablespaces: bool
supports_transactions: bool # type: ignore[assignment]
supports_transactions: bool
can_introspect_materialized_views: bool
can_distinct_on_fields: bool
can_rollback_ddl: bool
Expand Down
6 changes: 3 additions & 3 deletions django-stubs/db/models/expressions.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ class Star(Expression): ...
class Col(Expression):
target: Field
alias: str
contains_column_references: Literal[True] # type: ignore[assignment]
contains_column_references: Literal[True]
possibly_multivalued: Literal[False]
def __init__(self, alias: str, target: Field, output_field: Field | None = ...) -> None: ...

Expand Down Expand Up @@ -266,8 +266,8 @@ class OrderBy(Expression):

class Window(SQLiteNumericMixin, Expression):
template: str
contains_aggregate: Literal[False] # type: ignore[assignment]
contains_over_clause: Literal[True] # type: ignore[assignment]
contains_aggregate: Literal[False]
contains_over_clause: Literal[True]
partition_by: ExpressionList | None
order_by: ExpressionList | None
def __init__(
Expand Down
130 changes: 130 additions & 0 deletions scripts/stubtest/allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ django.core.management.color.Style.SQL_KEYWORD
django.core.management.color.Style.SQL_TABLE
django.core.management.color.Style.SUCCESS
django.core.management.color.Style.WARNING

# `error: <...> is not present at runtime`
# This happens often for variables removed in later django version.
# We still keep them in stubs to be a bit more backward compatible.
Expand Down Expand Up @@ -186,3 +187,132 @@ django.urls.resolvers.URLPattern.lookup_str
django.urls.resolvers.URLResolver.url_patterns
django.urls.resolvers.URLResolver.urlconf_module
django.utils.connection.BaseConnectionHandler.settings
django.contrib.admin.helpers.InlineAdminFormSet.non_form_errors
django.contrib.contenttypes.fields.ReverseGenericManyToOneDescriptor.related_manager_cls
django.contrib.gis.db.backends.base.operations.BaseSpatialOperations.select_extent
django.contrib.gis.db.backends.mysql.features.DatabaseFeatures.django_test_skips
django.contrib.gis.db.backends.mysql.features.DatabaseFeatures.supports_geometry_field_unique_index
django.contrib.gis.db.backends.mysql.operations.MySQLOperations.from_text
django.contrib.gis.db.backends.mysql.operations.MySQLOperations.gis_operators
django.contrib.gis.db.backends.mysql.operations.MySQLOperations.mariadb
django.contrib.gis.db.backends.mysql.operations.MySQLOperations.mysql
django.contrib.gis.db.backends.mysql.operations.MySQLOperations.select
django.contrib.gis.db.backends.mysql.operations.MySQLOperations.unsupported_functions
django.contrib.gis.db.backends.spatialite.features.DatabaseFeatures.supports_area_geodetic
django.contrib.gis.db.backends.spatialite.operations.SpatiaLiteOperations.unsupported_functions
django.contrib.gis.db.models.DecimalField.validators
django.contrib.gis.db.models.Field.cached_col
django.contrib.gis.db.models.Field.validators
django.contrib.gis.db.models.ForeignObject.foreign_related_fields
django.contrib.gis.db.models.ForeignObject.local_related_fields
django.contrib.gis.db.models.ForeignObject.related_fields
django.contrib.gis.db.models.ForeignObject.reverse_related_fields
django.contrib.gis.db.models.ForeignObjectRel.hidden
django.contrib.gis.db.models.ForeignObjectRel.many_to_many
django.contrib.gis.db.models.ForeignObjectRel.many_to_one
django.contrib.gis.db.models.ForeignObjectRel.name
django.contrib.gis.db.models.ForeignObjectRel.one_to_many
django.contrib.gis.db.models.ForeignObjectRel.one_to_one
django.contrib.gis.db.models.ForeignObjectRel.related_model
django.contrib.gis.db.models.IntegerField.validators
django.contrib.gis.db.models.Lookup.contains_aggregate
django.contrib.gis.db.models.Lookup.contains_over_clause
django.contrib.gis.gdal.GDALRaster.driver
django.contrib.gis.gdal.GDALRaster.is_vsi_based
django.contrib.gis.gdal.raster.source.GDALRaster.driver
django.contrib.gis.gdal.raster.source.GDALRaster.is_vsi_based
django.contrib.postgres.indexes.PostgresIndex.max_name_length
django.contrib.sessions.backends.db.SessionStore.model
django.db.backends.base.base.BaseDatabaseWrapper.timezone
django.db.backends.base.base.BaseDatabaseWrapper.timezone_name
django.db.backends.base.features.BaseDatabaseFeatures.supports_explaining_query_execution
django.db.backends.base.features.BaseDatabaseFeatures.supports_transactions
django.db.backends.mysql.features.DatabaseFeatures.allows_auto_pk_0
django.db.backends.mysql.features.DatabaseFeatures.can_introspect_check_constraints
django.db.backends.mysql.features.DatabaseFeatures.can_introspect_foreign_keys
django.db.backends.mysql.features.DatabaseFeatures.can_introspect_json_field
django.db.backends.mysql.features.DatabaseFeatures.can_return_columns_from_insert
django.db.backends.mysql.features.DatabaseFeatures.has_select_for_update_nowait
django.db.backends.mysql.features.DatabaseFeatures.has_select_for_update_of
django.db.backends.mysql.features.DatabaseFeatures.has_select_for_update_skip_locked
django.db.backends.mysql.features.DatabaseFeatures.has_zoneinfo_database
django.db.backends.mysql.features.DatabaseFeatures.ignores_table_name_case
django.db.backends.mysql.features.DatabaseFeatures.introspected_field_types
django.db.backends.mysql.features.DatabaseFeatures.is_sql_auto_is_null_enabled
django.db.backends.mysql.features.DatabaseFeatures.supported_explain_formats
django.db.backends.mysql.features.DatabaseFeatures.supports_column_check_constraints
django.db.backends.mysql.features.DatabaseFeatures.supports_default_in_lead_lag
django.db.backends.mysql.features.DatabaseFeatures.supports_explain_analyze
django.db.backends.mysql.features.DatabaseFeatures.supports_expression_indexes
django.db.backends.mysql.features.DatabaseFeatures.supports_index_column_ordering
django.db.backends.mysql.features.DatabaseFeatures.supports_over_clause
django.db.backends.mysql.features.DatabaseFeatures.supports_transactions
django.db.backends.mysql.features.DatabaseFeatures.update_can_self_select
django.db.backends.postgresql.base.DatabaseWrapper.pg_version
django.db.backends.postgresql.features.DatabaseFeatures.is_postgresql_13
django.db.models.DecimalField.validators
django.db.models.Field.cached_col
django.db.models.Field.validators
django.db.models.ForeignObject.foreign_related_fields
django.db.models.ForeignObject.local_related_fields
django.db.models.ForeignObject.related_fields
django.db.models.ForeignObject.reverse_related_fields
django.db.models.ForeignObjectRel.hidden
django.db.models.ForeignObjectRel.many_to_many
django.db.models.ForeignObjectRel.many_to_one
django.db.models.ForeignObjectRel.name
django.db.models.ForeignObjectRel.one_to_many
django.db.models.ForeignObjectRel.one_to_one
django.db.models.ForeignObjectRel.related_model
django.db.models.IntegerField.validators
django.db.models.Lookup.contains_aggregate
django.db.models.Lookup.contains_over_clause
django.db.models.expressions.BaseExpression.contains_aggregate
django.db.models.expressions.BaseExpression.contains_column_references
django.db.models.expressions.BaseExpression.contains_over_clause
django.db.models.expressions.BaseExpression.convert_value
django.db.models.fields.DecimalField.validators
django.db.models.fields.Field.cached_col
django.db.models.fields.Field.validators
django.db.models.fields.IntegerField.validators
django.db.models.fields.related.ForeignObject.foreign_related_fields
django.db.models.fields.related.ForeignObject.local_related_fields
django.db.models.fields.related.ForeignObject.related_fields
django.db.models.fields.related.ForeignObject.reverse_related_fields
django.db.models.fields.related.ForeignObjectRel.hidden
django.db.models.fields.related.ForeignObjectRel.many_to_many
django.db.models.fields.related.ForeignObjectRel.many_to_one
django.db.models.fields.related.ForeignObjectRel.name
django.db.models.fields.related.ForeignObjectRel.one_to_many
django.db.models.fields.related.ForeignObjectRel.one_to_one
django.db.models.fields.related.ForeignObjectRel.related_model
django.db.models.fields.related.ForwardManyToOneDescriptor.RelatedObjectDoesNotExist
django.db.models.fields.related.ManyToManyDescriptor.related_manager_cls
django.db.models.fields.related.RelatedField.related_model
django.db.models.fields.related.ReverseManyToOneDescriptor.related_manager_cls
django.db.models.fields.related.ReverseOneToOneDescriptor.RelatedObjectDoesNotExist
django.db.models.fields.related_descriptors.ForwardManyToOneDescriptor.RelatedObjectDoesNotExist
django.db.models.fields.related_descriptors.ManyToManyDescriptor.related_manager_cls
django.db.models.fields.related_descriptors.ReverseManyToOneDescriptor.related_manager_cls
django.db.models.fields.related_descriptors.ReverseOneToOneDescriptor.RelatedObjectDoesNotExist
django.db.models.fields.reverse_related.ForeignObjectRel.hidden
django.db.models.fields.reverse_related.ForeignObjectRel.many_to_many
django.db.models.fields.reverse_related.ForeignObjectRel.many_to_one
django.db.models.fields.reverse_related.ForeignObjectRel.name
django.db.models.fields.reverse_related.ForeignObjectRel.one_to_many
django.db.models.fields.reverse_related.ForeignObjectRel.one_to_one
django.db.models.fields.reverse_related.ForeignObjectRel.related_model
django.db.models.lookups.Lookup.contains_aggregate
django.db.models.lookups.Lookup.contains_over_clause
django.db.models.options.Options.base_manager
django.db.models.options.Options.db_returning_fields
django.db.models.options.Options.default_manager
django.db.models.options.Options.fields
django.db.models.options.Options.fields_map
django.db.models.options.Options.managers
django.db.models.options.Options.managers_map
django.db.models.options.Options.total_unique_constraints
django.http.HttpRequest.accepted_types
django.http.HttpRequest.headers
django.http.request.HttpRequest.accepted_types
django.http.request.HttpRequest.headers

0 comments on commit 3ec21c8

Please sign in to comment.