Use DeprecationWarning instead of FutureWarning for shapely.ops.transform() deprecation - #2524
Merged
jorisvandenbossche merged 1 commit intoOct 5, 2026
Conversation
…form() deprecation
This was referenced Oct 2, 2026
Open
caspervdw
approved these changes
Oct 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Last
transform-related PR (I think ;))If we keep the deprecation of
shapely.ops.transform, I think we should start with raising a DeprecationWarning instead of a FutureWarning (we can bump it later to a FutureWarning in a next release). Since thetransformfunction is used quite a bit in downstream packages, starting with a DeprecationWarning would ensure that the users of those downstream packages don't yet directly see the warning (a warning they can't do anything about themselves), while users that useshapely.ops.transformdirectly will still see the warning.(see the table at https://docs.python.org/3/library/warnings.html#warning-categories and the note just below it)
It is a bit unfortunate that the
ShapelyDeprecationWarningis actuallyFutureWarning(for many years, and raise by some attributes, so I wouldn't change that now). We could add something likeclass ShapelyPendingDeprecationWarning(DeprecationWarning), but not sure that is useful / less confusing. I noticed that for thedeprecate_positionaldeprecations we added in 2.1, we also used plainDeprecationWarning, so doing that here as well.