Repository navigation
Fix numeric GeoJSON column offsets in csvjson - #1404
Open
chaser940428-pixel wants to merge 1 commit into
Open
chaser940428-pixel wants to merge 1 commit into
chaser940428-pixel wants to merge 1 commit into
Conversation
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.
Fixes #1403.
csvjsonpassed the--zeroboolean directly asmatch_column_identifier's column offset. As a result, numeric GeoJSON selectors were zero-based by default and one-based with--zero. For example,--lat 2 --lon 3onid,lat,lon,extrasilently usedlon,extraas the coordinates.Convert the flag to the expected offset once and apply it to latitude, longitude, type, geometry, and feature ID selectors. Named selectors keep their existing behavior.
Regression tests compare complete features for named, one-based, and zero-based selections in collection, buffered-stream, and fast-stream modes, including geometry and feature ID selection, bounding boxes, and invalid index errors. Add a changelog entry.
Validation on Windows / Python 3.13.5 against the checkout:
PYTHONUTF8=1 python -m pytest --cov csvkit -q: 371 passed, 3 skipped, 51 subtests passed.python -m flake8 .,PYTHONUTF8=1 python -m isort . --check-only, andgit diff --check: passed.python -m check_manifest --no-build-isolation: passed.AI assistance was used to investigate, implement, and test this change.