Sitelet https://github.com/shapely/shapely/pull/2524
Skip to content

Use DeprecationWarning instead of FutureWarning for shapely.ops.transform() deprecation - #2524

Merged
jorisvandenbossche merged 1 commit into
shapely:mainfrom
jorisvandenbossche:transform-ops-deprecation-warning
Oct 5, 2026
Merged

jorisvandenbossche merged 1 commit into
shapely:mainfrom
jorisvandenbossche:transform-ops-deprecation-warning

Conversation

@jorisvandenbossche

Copy link
Copy Markdown
Member

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 the transform function 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 use shapely.ops.transform directly 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 ShapelyDeprecationWarning is actually FutureWarning (for many years, and raise by some attributes, so I wouldn't change that now). We could add something like class ShapelyPendingDeprecationWarning(DeprecationWarning), but not sure that is useful / less confusing. I noticed that for the deprecate_positional deprecations we added in 2.1, we also used plain DeprecationWarning, so doing that here as well.

@jorisvandenbossche
jorisvandenbossche merged commit 68ff25b into shapely:main Oct 5, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants