Skip to content

v5.3.0

Choose a tag to compare

@mbewley mbewley released this 03 Nov 03:12
· 181 commits to main since this release
930cee8

What's New

This release closes two ways an export could finish successfully with data silently missing or wrong: a chunk file that failed to write, and a resume with changed settings that merged chunks from the earlier run. It also checks packs and classes before sending any request, and writes all GeoParquet output as version 1.0.0.

Bug Fixes

  • A failed chunk file write now stops the export instead of losing rows. Before, if a chunk's features, per-class or errors file failed to write, the failure was logged and the chunk was still marked complete. The export finished without that chunk's rows, and a resume never re-processed it. Now any failed chunk file leaves the chunk incomplete. The other chunks still finish, and the merge then exits 1 and names every incomplete chunk. Re-running the same command re-processes only those chunks, using cached API responses. (#243)
  • Rollup chunk writes to S3 no longer fail now and then. Before, every rollup chunk was uploaded twice: first as an empty file, caused by a TypeError inside the open S3 file, then for real by a fallback. If the empty upload failed (S3 IncompleteBody, which s3fs does not retry), the fallback never ran. The chunk then had no rollup, and the export stopped at the merge until it was re-run. Now each rollup chunk is uploaded once, with its data. (#243)
  • A failed roof age errors write no longer stops every chunk. Before, it raised out of the chunk and ended the whole export. Now it leaves only that chunk incomplete, like any other failed chunk file. (#243)
  • Conflicts between packs and classes are now checked at start. Before, the CLI defaulted --packs to building even when --classes was given. It sent both, and the Feature API rejected every request with 400 Only one of 'packs' or 'classes' query parameters may be set. Now building is the default only when neither is given. Giving both is refused before any request is sent: the CLI exits with an argument error, and NearmapAIExporter raises ValueError. (#244, carrying #240 by @DmitryKotuseu)
  • Unknown class ids are now checked at start. Before, a class id missing from get_feature_classes() was silently dropped. That covers a typo, and also several ids joined by commas into one argument. The export then finished with no per-class outputs and no error. Now it raises ValueError("Unknown classes: [...]") before any AOI is requested. (#244)
  • The class list now comes from the configured url_root. Before, it always came from the default host, even when feature requests went to another one. The class list could then disagree with the host being queried, and the default host had to be reachable. (#239 by @DmitryKotuseu)
  • The error summary no longer grows by one row per failed grid. Before, a rejected grid's message included its exact cell counts, so almost every failed grid had its own row in the summary. On a large export with patchy coverage that meant hundreds of rows. Now grids that failed alike share one message, which gives the share of cells answered as a 10-point bracket and the distinct failed statuses, for example Rejected as only [80-90)% of grid cells answered, below the 100% threshold. Failed due to {404}. The exact counts remain on the error row (grid_cells, grid_cells_answered, answered_area_fraction). (#242)

Behaviour Changes

  • A resume must use the settings that wrote its chunks. Before, a resume with changed settings merged the earlier run's chunks into the new output with no warning. Now NearmapAIExporter raises ValueError when chunks/ holds completed chunks and the previous run's final/export_config.json differs or is missing. Only processes, threads, merge_read_workers, max_retries and the cache options (cache_dir, compress_cache, no_cache, overwrite_cache) may change, and the order of packs, classes and include doesn't matter. To export with new settings, use a new output directory or delete chunks/.
    • chunk_size can no longer change on a resume, because it moves the chunk boundaries under the completed chunks. This includes re-running a finished export, which used to return straight away.
    • Settings that only the merge uses, such as tabular_file_format, are refused too.
    • The check runs before export_config.json is overwritten, so a refused run can be retried with the original settings.
  • An export with a failed chunk write now fails. It exits 1 at the merge, where it used to complete without that chunk's rows. A failure that recurs on every run keeps the export failing until its cause is fixed.
  • The merge error message changed. It used to say "N of M chunks have an error file but no rollup file". It now says "N of M chunks have no rollup file" and names every such chunk. Each incomplete chunk also logs Chunk NNNN gets no rollup and will be re-processed on resume: failed ....
  • features_<chunk>.parquet is now written only with --save-features (save_features=True), the only setting that reads it.
  • Every GeoParquet file written through storage.write_parquet is now GeoParquet 1.0.0, whatever the geopandas version. geopandas 1.2 changed its default to 1.1.0, so on geopandas 1.2 the errors GeoParquet, the per-class chunk geometry files, and the roof age and damage conflation outputs became 1.1.0. Readers pinned to GeoParquet 1.0 may reject those files. To write another version, pass schema_version explicitly.
  • The grid rejection message format changed (see Bug Fixes). Code that parses the old N of M grid cells answered text should read the error row's columns instead.

Notes

  • Exports started on 5.2.0 resume on 5.3.0 if their settings are unchanged: both versions save the same set of config keys.
  • Callers that run their own resumes must keep the export config the same between runs into one output directory, or start a new output directory.
  • Known issue, not changed: --include-parcel-geometry has not added geometry to the rollup since January 2025. It still affects the features file. A fix will come separately.
  • No dependency changes since 5.2.0.