Skip to content

[GH-3509] Compare GeoSeries scale/skew coordinates vertex by vertex - #3510

Merged
jiayuasu merged 1 commit into
apache:masterfrom
jiayuasu:fix/pytest-approx-nested-coords
Oct 30, 2026
Merged

jiayuasu merged 1 commit into
apache:masterfrom
jiayuasu:fix/pytest-approx-nested-coords

Conversation

@jiayuasu

Copy link
Copy Markdown
Member

Did you read the Contributor Guide?

Is this PR related to a ticket?

What changes were proposed in this PR?

pytest 9.2.0, released 2026-10-27, rejects nested sequences in pytest.approx:

TypeError: pytest.approx() does not support nested data structures: (1, 4, 12) at index 0

python/pyproject.toml lists pytest without a version bound, so the Python build now resolves 9.2.0, and nine tests in tests/geopandas/test_geoseries.py fail:

  • TestGeoSeries::test_scale_3d_explicit_origin (all four parameters)
  • TestGeoSeries::test_skew_degrees_radians_and_180_degree_clamp
  • TestGeoSeries::test_skew_explicit_origins_ignore_z (all four parameters)

Each of them compared a list of coordinate tuples with one pytest.approx(expected). They now wrap each coordinate tuple in its own approx, [pytest.approx(c) for c in expected], which behaves the same on pytest 9.1 and 9.2. Only these tests change.

How was this patch tested?

  • Reproduced the error with pytest 9.2.0 on [(1, 4, 12)] == pytest.approx([(1, 4, 12)]). The same assertion passes on pytest 9.1.1.
  • With the expected coordinates from these tests, the new form passes on both pytest 9.1.1 and 9.2.0. It still rejects a wrong value, a missing vertex and a dropped Z.
  • black 26.5.1, the pre-commit pin, leaves the file unchanged.
  • The GeoPandas tests themselves run in this PR's Python build.

Did this PR include necessary documentation updates?

  • No, this PR does not affect any public API so no need to change the documentation.

…rtex

pytest 9.2.0 rejects nested sequences in pytest.approx ("does not support
nested data structures"), which broke test_scale_3d_explicit_origin,
test_skew_degrees_radians_and_180_degree_clamp and
test_skew_explicit_origins_ignore_z. Wrap each coordinate tuple in its own
approx instead, which behaves the same on pytest 9.1 and 9.2.
@jiayuasu
jiayuasu merged commit 4a96b29 into apache:master Oct 30, 2026
34 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.

GeoSeries scale and skew tests fail with pytest 9.2.0

1 participant