Skip to content

chore: sync fork with upstream batch-machine 10.2.0 - #1

Merged
MiniCodeMonkey merged 28 commits into
masterfrom
sync/upstream-10.2.0
Aug 28, 2026
Merged

chore: sync fork with upstream batch-machine 10.2.0#1
MiniCodeMonkey merged 28 commits into
masterfrom
sync/upstream-10.2.0

Conversation

@MiniCodeMonkey

Copy link
Copy Markdown
Member

Summary

The fork was 25 commits behind upstream/master (now at v10.2.0) and 8 ahead. This merges upstream in, preserving every fork-only patch. It's the prerequisite for the NaN-geometry fix, which stacks on this branch.

Merged rather than rebased, matching the shape of the previous sync (024c1fc6).

Changes

Two conflicts, both resolved by keeping both sides:

  • README.md -- upstream's KML support sentence alongside the fork-notes section.
  • openaddr/conform.py -- upstream's new HasCurveGeometry() linearization block landed directly above the if source_config.layer == "addresses" line the fork patched, so git couldn't auto-merge. The result keeps both: linearization and and not disable_centroids.

All fork-only work survives:

Patch Where it lives now
--disable-centroids (2d31d44e, 666cf974, b1bb4cda, b0880837) process_one.py:410, conform.py:707,858,956, __init__.py:105
Dockerfile expat/pyexpat ABI fix (989ffd20) Dockerfile:7, auto-merged
building_name support (9ce4f6b0, 5145ed48) conform.py:49,1225

Verification

--disable-centroids has no test coverage, so it was exercised end-to-end after the merge rather than just checked structurally:

disable_centroids=False -> POINT (-122.255 37.805)
disable_centroids=True  -> POLYGON ((-122.26 37.8,-122.25 37.8,...

The KML sources new in 10.2.0 route through ogr_source_to_csv, which already accepts disable_centroids, so the flag covers them too.

Full suite via the CI path (docker run machine): 128 tests, OK.

rmx90210 and others added 27 commits August 13, 2026 11:11
guess_url_file_extension() made its own GET request to sniff the
Content-Type before the real download, but never carried any custom
headers. On a header-gated host (e.g. one requiring Referer) that
pre-flight request would fail even after headers are wired through
the rest of the download path.
…nloads

DownloadTask.__init__ already accepted a headers dict, but
from_protocol_string() - the only production call site - never
passed one through, so self.headers was always just the default
User-Agent. EsriRestDownloadTask also built its EsriDumper without
headers despite pyesridump already supporting extra_headers.
Wires the source-supplied 'headers' dict (added to the schema
separately in openaddresses/openaddresses) into the download path.
conform() deliberately does not forward headers: it re-downloads
from the OA-owned cache artifact, not the contributor's host.
Covers: from_protocol_string() forwarding headers to URLDownloadTask
and EsriRestDownloadTask, default User-Agent survives alongside
custom headers (and can be overridden), headers reaching both the
extension-guessing pre-flight request and the real download request,
and EsriRestDownloadTask passing headers to EsriDumper as
extra_headers.
Fill in the CHANGELOG's PR link once this is merged.
Review feedback on openaddresses/openaddresses#8306: wrapping headers
in a container leaves room for query params (e.g. a token) later
without a second schema migration. No source uses the flat key yet,
so this costs nothing now.
Further review feedback on openaddresses/openaddresses#8306:
iandees agreed 'request' is shorter and reads better than
http_request_settings. Source key is now request.headers.
…-image-digest

Pin gdal base image to digest
…p-headers

Send custom HTTP request headers when downloading a source
…json-nonuniform-properties

Fix geojson_source_to_csv crash on non-uniform feature properties
…regexp-replace

Fix regexp replace to return empty string when pattern does not match
…multisurface

Linearize curve geometries before exporting to WKT
…7-kml-support

Add KML support to conform pipeline
…lat-lon-flip

Fix lat/lon axis flip for sources with an explicit srs tag
…35-nested-zip

Extract nested zip files regardless of conform file filter
Brings the fork up to upstream 10.2.0. Conflicts resolved by keeping both
sides: upstream's KML support note and curve-geometry linearization, plus
the fork's --disable-centroids guard and Geocodio fork notes.

Claude-Session: https://claude.ai/code/session_01JWLFBWRfhWhLUqFFqbPCGm
ESRI services report a null point geometry as the string "NaN" rather than
omitting the geometry. Bradford County PA (source 1078) has 67 such records,
and they reached the addresses output as "coordinates": [NaN, NaN] — invalid
GeoJSON per RFC 7946, which made the whole 39,638-feature file unparseable by
Go's encoding/json.

Two guards were meant to catch this and neither did:

- openaddr/cache.py walked traverse(geom), which yields the geometry dict
  itself rather than its coordinates, so the isnan() test never ran on a
  coordinate. It also only recognized float NaN, not the string ESRI sends.
- openaddr/conform.py compared the WKT against the literal "POINT (nan nan)",
  which was Shapely 1.x's spelling. Shapely 2 / GEOS 3.13 writes
  "POINT (NaN NaN)", so the comparison stopped matching.

Skip the feature at download time, matching how every other geometry-less ESRI
feature is already handled, and fall back to a null geometry further down the
pipeline for the non-ESRI paths. json.dumps now runs with allow_nan=False so
this class of bug fails loudly here instead of silently downstream.

test_single_ny_orange asserted a golden row hash derived from the cache file's
md5 fingerprint; dropping the bogus row changes that fingerprint, so the hash
moves and the test now also asserts the feature count and the absence of NaN.

Claude-Session: https://claude.ai/code/session_01JWLFBWRfhWhLUqFFqbPCGm
fix(conform): never write NaN coordinates to the output GeoJSON
@MiniCodeMonkey
MiniCodeMonkey merged commit 8d16b3a into master Aug 28, 2026
1 check 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.

3 participants