Skip to content

Fix GIS as_sql stub signatures to match runtime#3212

Open
ahmedasar00 wants to merge 3 commits intotypeddjango:masterfrom
ahmedasar00:fix/gis-as-sql-stubs
Open

Fix GIS as_sql stub signatures to match runtime#3212
ahmedasar00 wants to merge 3 commits intotypeddjango:masterfrom
ahmedasar00:fix/gis-as-sql-stubs

Conversation

@ahmedasar00
Copy link
Copy Markdown
Contributor

@ahmedasar00 ahmedasar00 commented Mar 22, 2026

Summary

Add missing as_sql method stubs to GIS modules.

Changes

  • Add GeoFuncMixin.as_sql stub
  • Add Area.as_sql override stub
  • Add Length.as_sql override stub
  • Add RasterBandTransform.as_sql stub
  • Add # type: ignore[misc] to classes with MRO conflicts
  • Remove 4 entries from allowlist_todo.txt

Why type: ignore[misc]?

Django's GeoFuncMixin.as_sql intentionally narrows the signature from Func.as_sql by removing template and arg_joiner parameters. This causes MRO conflicts that are expected and safe to ignore.

Refs allowlist_todo.txt entries:

  • django.contrib.gis.db.models.functions.Area.as_sql
  • django.contrib.gis.db.models.functions.GeoFuncMixin.as_sql
  • django.contrib.gis.db.models.functions.Length.as_sql
  • django.contrib.gis.db.models.lookups.RasterBandTransform.as_sql

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.

1 participant