Skip to content

[0.4.1] Develop to Main#65

Merged
sujata-m merged 2 commits into
mainfrom
develop
May 28, 2026
Merged

[0.4.1] Develop to Main#65
sujata-m merged 2 commits into
mainfrom
develop

Conversation

@sujata-m

Copy link
Copy Markdown
Contributor

Dev Board Ticket

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).
  • Added a new helper _read_geojson_without_ext in helpers.py that loads the GeoJSON via json, strips ext:* properties from each feature, and builds the GeoDataFrame via gpd.GeoDataFrame.from_features.
  • Added .coveragerc to omit version.py and example.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.

sujata-m and others added 2 commits May 28, 2026 13:15
## 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
@sujata-m sujata-m requested review from MashB and susrisha May 28, 2026 07:50
@sujata-m sujata-m merged commit 3c78e47 into main May 28, 2026
7 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.

2 participants