Conversation
4022dd8 to
6d692de
Compare
…ins, bool) Implements Phase 3 Surface 2 per docs/design/pythonic-wkl.md. Wkl now behaves like a stdlib collections.abc.Sequence on the rows of the resolved result set: len(wkl) # row count for row in wkl # iterate; each row is itself a single-row Wkl wkl[0], wkl[-1] # positional index (negatives supported) wkl[:5] # slice; returns a multi-row Wkl bool(wkl) # True iff non-empty uuid in wkl # membership check against the id column Iteration is backed by a cached pyarrow Table (_arrow_table) so len/iter/getitem don't fire one sedona round-trip per row. Per-row Wkls are constructed by slicing the table and re-wrapping via sedona.create_data_frame — no SQL per step. Also in this commit: - Narrowed __getattr__ passthrough on result-mode Wkl to the explicit _DIR_DATAFRAME_METHODS allowlist. Anything outside it (e.g. .filter, .select, .group_by) now raises AttributeError with a pointer at .resolve() instead of silently forwarding to sedona. - .head(n) / .limit(n) now return a Wkl (was: sedona DataFrame). Fixes the .head(3).to_dicts() trap from the Copilot usability review. - Replaced the bracket-access deprecation shim. String subscripts now raise TypeError pointing at dot access / .search() / .resolve(); list subscripts and other key types raise TypeError as well. DeprecationWarning was the v1.2 behavior; v1.3 enforces. Module docstring updated to teach the new Sequence idioms in the Inspection paragraph. __repr__ is intentionally unchanged — see docs/architecture/three-surface-api.md "Changing the repr (considered, deferred)".
New tests/test_pythonic.py exercises the v1.3 Surface 2 contract end to end: len/bool/iter/getitem/contains across chain-mode, result-mode, empty, and root Wkl edge cases; head(n)/limit(n) returning Wkl; the .head(3).to_dicts() chain that used to fail; the narrowed __getattr__ raising AttributeError with .resolve() pointers; row-Wkl integration (.wkt, .path, .parent on a yielded row). tests/test_deprecation.py rewritten: the bracket-access shim is gone, so the file now asserts the v1.3 TypeError replacement (matching the "considered, deferred" deprecation policy). tests/test_errors.py: removed the obsolete companion test that exercised Wkl()["..."] hint rendering via the shim. TypeError coverage lives in test_deprecation.py now. tests/conftest.py: dropped the unused ignore_bracket_deprecation fixture (no remaining callers).
6d692de to
6f35ef3
Compare
b41c60b to
25ba113
Compare
4c7b43c to
cff639a
Compare
Remove silent DataFrame passthrough from result-mode Wkls. Every unknown attribute now raises AttributeError with a priority-ordered redirect (Surface 1 > Surface 2 > Surface 3). Migrate all tests from .count()/.head()/.show() to len()/[:n] equivalents.
cff639a to
21ddb37
Compare
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.
Summary
Ship the three-surface API for wkls v1.2.0:
len(),iter(),[],in,bool()to_arrow_table()returnspyarrow.Tablewith GeoArrow WKB geometryBreaking changes
resolve()removed — useto_arrow_table()insteadsvg()andhexwkb()removed (wereNotImplementedErrorstubs)__getattr__passthrough removed —.count(),.head(),.show(),.filter()etc. now raiseAttributeErrorwith priority-ordered redirects pointing at the correct Surfaceto_dicts()is metadata-only by contract (no geometry)Commits
feat!: remove unimplemented svg() and hexwkb() methodsrefactor: rename Wkl.resolve to private _resolvefeat!: add Wkl.to_arrow_table() with direct Overture queryfeat!: empty __getattr__ allowlist with priority-ordered redirectsdocs: README + CHANGELOG for v1.2.0