Conversation
## Dev Board Ticket - https://dev.azure.com/TDEI-UW/TDEI/_workitems/edit/3297/ ## Changes - Fixed misleading `Expecting value: line 1 column 1 (char 0)` error when validating GeoJSON files where an `ext:*` extension property holds mixed value types across features (e.g. `ext:TextRotation` is `310.0` in some features and `"not_appl"` in others). pyogrio/GDAL infers a single dtype per property column and fails on the mismatch, even though the GeoJSON is valid and the schema permits free-form `ext:*` tags. - Added a new helper `_read_geojson_without_ext` in `src/python_osw_validation/helpers.py` that loads the GeoJSON via `json`, strips `ext:*` properties from each feature, and builds the `GeoDataFrame` via `gpd.GeoDataFrame.from_features`. Schema-level validation of `ext:*` properties (including the "change it to ext:" hint) is unchanged — stripping happens only for the internal GeoDataFrame used for geometry and `_id` integrity checks. - Replaced the two `gpd.read_file(...)` call sites in `src/python_osw_validation/__init__.py` (main dataset load and external-extension load) with the new helper. - Added `.coveragerc` to omit `src/python_osw_validation/version.py` from the coverage report. - Bumped package version to `0.4.1` and updated `CHANGELOG.md`. ## Testing - Added 5 unit tests in `tests/unit_tests/test_helpers.py` covering: the exact mixed-type `ext:*` bug repro, preservation of non-ext properties, no-op behavior when no `ext:*` keys are present, empty `FeatureCollection`, and CRS propagation. - Updated the monkey-patch target in `tests/unit_tests/test_osw_validation_extras.py` from `gpd.read_file` to `_read_geojson_without_ext` so the existing GeoDataFrame-load tests continue to intercept the load path correctly. - Verified end-to-end against `tests/assets/SDOT_lanewidth_osw.points.geojson.zip` (the original failing dataset): validation now returns `issues=[]` instead of the prior JSON parse error. - Full unit-test suite: 167 passed - Coverage: 92%, with `version.py` correctly omitted from the report.
[0.4.1] Fix GeoJSON load failure on mixed-type ext:* properties
shweta2101
approved these changes
May 28, 2026
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.
Dev Board Ticket
Changes
Expecting value: line 1 column 1 (char 0)error when validating GeoJSON files where anext:*extension property holds mixed value types across features (e.g.ext:TextRotationis310.0in some features and"not_appl"in others)._read_geojson_without_extinhelpers.pythat loads the GeoJSON viajson, stripsext:*properties from each feature, and builds theGeoDataFrameviagpd.GeoDataFrame.from_features..coveragercto omitversion.pyandexample.pyfrom the coverage report.0.4.1and updatedCHANGELOG.md.Testing
tests/unit_tests/test_helpers.pycovering: the exact mixed-typeext:*bug repro, preservation of non-ext properties, no-op behavior when noext:*keys are present, emptyFeatureCollection, and CRS propagation.tests/unit_tests/test_osw_validation_extras.pyfromgpd.read_fileto_read_geojson_without_extso the existing GeoDataFrame-load tests continue to intercept the load path correctly.tests/assets/SDOT_lanewidth_osw.points.geojson.zip(the original failing dataset): validation now returnsissues=[]instead of the prior JSON parse error.version.pycorrectly omitted from the report.