Skip to content

Updates 202606 - #90

Merged
keewis merged 23 commits into
mainfrom
updates-202606
Oct 1, 2026
Merged

keewis merged 23 commits into
mainfrom
updates-202606

Conversation

@nmandery

@nmandery nmandery commented Jun 24, 2026 •

Copy link
Copy Markdown
Owner

@regislon

regislon commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Hi @nmandery — I just took the opportunity of having Fable 5 back to dig a little into this PR and the migration work you did here. First of all: really nice job, this is a big update and it reads very cleanly — and CI is green across the board. While going through it I spotted a few small things that might be worth a look, roughly by severity:

1. cells_to_wkb_polygons output changed from LargeBinary to Binary (i32 offsets).
In geoarrow-array 0.8, WkbArray is an alias for GenericWkbArray<i32>, so the new let out: WkbArray = ... (and the to_wkb_polygons call it forces) produces i32 offsets, while main used WKBArray<i64>. Verified by building this branch vs 0.22.0 from PyPI:

cells = geometry_to_cells(shapely.Point(8.9, 47.2), 8)
cells_to_wkb_polygons(cells).type
# 0.22.0:  arro3.core.DataType<LargeBinary>
# PR readthedocs/readthedocs.org#90:  arro3.core.DataType<Binary>

Besides the dtype change, WKB payloads > 2 GiB (~16M hexagon polygons) would panic on offset overflow, and it's inconsistent with cells_to_wkb_points / vertexes_to_wkb_points / directededges_to_wkb_linestrings, which still use <i64>. Suggested fix: GenericWkbArray<i64> (or the LargeWkbArray alias).

2. Empty geometries now yield nulls instead of empty cell lists. geo_traits::to_geo::ToGeoGeometry::try_to_geometry returns None for empty geometries, and from_geoarrow.rs maps that to Ok(None) → null entry, where main returned a valid empty list (and some POINT EMPTY-style WKB previously raised an error). If intentional, it may deserve a CHANGES.rst note since wkb_to_cells(..., flatten=False) list semantics change.

3. The .expect("wkbarray") calls are now reachable. The WKB conversion error type changed from Infallible to a real error, so the pre-existing expects in the four *_to_wkb_* functions became live panic paths — worth converting to into_pyresult()?.

4. Minor: the WKB output field name changed from "geometry" to "" (extension_field() → data_type().to_field("", true)); geozero is bumped but appears to have no remaining usages and could be dropped; rasterh3 0.12 (2026-06-26) was released just after this branch and contains antimeridian/resolution-search fixes; crates/h3arrow/CHANGES.md has no entry for the 0.5.0 bump.

If you don't mind, I can propose these improvements directly in the PR, and you can validate them later on.

@nmandery

nmandery commented Jul 3, 2026

Copy link
Copy Markdown
Owner Author

Hi @regislon Thanks for looking into this - these are all valid findings. Please just go ahead and start a PR to address these.

For some of the issues like point 3 and the rasterh3 upgrade I also have started to prepare fixes, but so far that is not finished.

regislon and others added 8 commits August 12, 2026 08:01
geoarrow-array 0.8's `WkbArray` is an alias for `GenericWkbArray<i32>`, so
the migration silently changed the output of cells_to_wkb_polygons from
large_binary to binary. This was inconsistent with the other *_to_wkb_*
functions (which kept <i64>) and would panic on i32 offset overflow for
WKB payloads over 2 GiB.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The ToWKB* error type changed from Infallible to a real error in the
geoarrow 0.8 migration, turning the pre-existing .expect("wkbarray")
calls into reachable panic paths. Convert them into Python exceptions.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The migration replaced extension_field() with data_type().to_field("", true),
changing the arro3-visible field name from "geometry" to "".

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Picks up the antimeridian and resolution-search fixes released on
2026-06-26, plus iterator perf improvements.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Allows using the enum as a dict key / in sets, as expected from a Python
enum. It was unhashable in 0.22 as well (eq without hash removes the
default __hash__).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- all *_to_wkb_* functions return large_binary (i64 offsets)
- WKB output field is named "geometry" and carries the geoarrow.wkb
  extension metadata
- wkb_to_cells: flatten/list consistency, per-geometry compact round-trip
  via uncompact, containment mode ordering, null entry preservation
- document the pre-existing compact+flatten 'heterogeneous resolution'
  failure (present in 0.22.0 as well) as xfail

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@keewis keewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

some small nits, otherwise this looks good to me (and tests pass). Shall we merge this now and follow up with smaller PRs afterwards?

Comment thread crates/h3arrow/src/algorithm/string.rs Outdated
Comment thread crates/h3arrow/Cargo.toml Outdated
@keewis

keewis commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

@nmandery, my suggestions here are purely aesthetical (I guess), so feel free to merge whenever you feel this is ready.

How do we proceed with #94? Should we convert both into stacked PRs?

@nmandery

Copy link
Copy Markdown
Owner Author

Your suggestions are perfectly valid and I would also prefer to have them addressed.

Not having worked with stacked PRs before, I would simply merge #94 into #90 and then into main.

@keewis

keewis commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator

@nmandery, I've added the small changes I've suggested in the reviews. Should CI pass, I'll merge this in a week and release afterwards (though if you have the time feel free to merge and optionally release yourself).

@keewis
keewis merged commit 2138a1f into main Oct 1, 2026
16 of 17 checks passed
@keewis
keewis deleted the updates-202606 branch October 1, 2026 08:51
@keewis

keewis commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

thanks again!

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.

bump rust dependencies

3 participants