Repository navigation
fix(models): require whole numeric strings and real timestamps - #50
Merged
Merged
Conversation
Fixes #46. json_number_or_numeric_string took a string's leading number, so "5xyz" was 5 and a fire-weather dn of "5xyz" became ELEV, while the no-risk check required the whole string. Now every numeric field does. Fixes #49. spc_ts_to_iso8601 reformatted any twelve digits, turning 202613400000 into 2026-13-40T00:00:00Z. Digits that name no real UTC time are returned as sent, as the helper documents. No captured fixture has either shape, so golden output is unchanged.
…ero bands
From review: std::chrono::year{0} is ok(), but the civil calendar has no
year 0 and Postgres rejects it. The dn cases "0abc" and "0 " read as 0
with or without the fix, so "5 " and "5e" now guard against a revert.
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.
Summary
Fixes #46. Fixes #49. Both reproduced on v0.4.8 through the public
parse_*API before the fix.json_number_or_numeric_stringtook a string's leading number. So"5xyz"was 5,"2.5in"2.5, and"123abc"123, and a fire-weatherdnof"5xyz"became an ELEV band.dn:"0abc") was already skipped in v0.4.8.spc_ts_to_iso8601reformatted any twelve digits, so202613400000became2026-13-40T00:00:00Z.Parity: spc-data links spc-cpp and stores this output. Among the captured fixtures:
So output on published data is unchanged, and
tests/golden/didn't move.Testing
make test,make lint,make lint-md,make fixtures-check, andmake test-consumerspassCHANGELOG.mdhas an[Unreleased]entry for user-visible changesWhere it ran:
Live:
tools/verify_arcgis_metadata.pyand every example pass, and real SPC timestamps still convert.Review: an independent review found two issues, both fixed in the second commit. Year 0 was accepted, and two tests couldn't catch a revert. The re-review approved.