Skip to content

Conversation

@JaeHyuckSa
Copy link
Contributor

I have made things!

Update stubs for django.contrib.gis.db.backends.postgis.operations for Django 5.0.

  • django.contrib.gis.db.backends.postgis.operations
    • django.contrib.gis.db.backends.postgis.operations.PostGISOperator.check_geography was added

Related issues

Refs

Upstream PR

@sudosubin sudosubin mentioned this pull request May 9, 2024
39 tasks
Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

I misclicked. This needs to be changed

@JaeHyuckSa
Copy link
Contributor Author

Just like in as_sql:

template_params: Mapping[str, Any],

which calls check_geometry: https://github.com/django/django/blob/d59066b90c2ef91a956c6682ed3d25bbb31bf216/django/contrib/gis/db/backends/postgis/operations.py#L42
But! as_sql also calls check_raster which uses mutation :( https://github.com/django/django/blob/d59066b90c2ef91a956c6682ed3d25bbb31bf216/django/contrib/gis/db/backends/postgis/operations.py#L59-L62

https://github.com/django/django/blob/d59066b90c2ef91a956c6682ed3d25bbb31bf216/django/contrib/gis/db/backends/postgis/operations.py#L79

So, template_params is at least MutableMapping

I appreciate your thorough explanation! Thanks to your guidance, I now have a clear understanding. I've revised the section accordingly and have uploaded the updates. Thank you for your assistance!

@JaeHyuckSa JaeHyuckSa requested a review from sobolevn May 11, 2024 14:38
Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

Please, also update .as_sql method from the base class

@JaeHyuckSa
Copy link
Contributor Author

Please, also update .as_sql method from the base class

Thank you for your guidance in revising it! :)

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

Thanks!

@sobolevn sobolevn merged commit a70e45c into typeddjango:master May 13, 2024
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