Repository navigation
Engine fixes: convert blocks on sense-check errors, date-parsed stale-FX, unresolved FX left blank, ingest.read_large_rows - #28
Merged
Conversation
…, unresolved FX left blank, ingest.read_large_rows (v0.8.10) - convert.py: convert_file refuses to write when sense_check has any error (blocked_by: contract / sense_check); render_report states why; CLI exits 1 - convert.py: new _to_date / _fx_resolve; date-keyed FX rows that predate every pinned rate or have blank/unparseable dates are left blank and flagged fx_rate_unresolved (was: silently used earliest/latest rate); _field / apply_map gain optional flags= / issues= - convert.py: stale-FX sense-check parses both dates (was a raw string compare that broke on DD MMM YYYY), judges a rates table by its latest as_of, adds fx_date_unparsed warning; --as-of help clarified; self-test extended - ingest.py: additive read_large_rows(path, sheet=None, cache_dir=None) drop-in returning (rows, note) in read_any shape; non-Excel falls back to read_any - docs: data-convert SKILL.md + conversion-spec.md; data-analyse / data-tidy SKILL.md + large-file-patterns.md - tests: 4 new engine tests (116 -> 120) - plugin.json 0.8.9 -> 0.8.10 + CHANGELOG (tag/release to follow on merge) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Engine-safety fixes for
data-convertplus an additive large-file reader iningest. Bumpsplugin.json0.8.9 → 0.8.10 with a dated CHANGELOG entry.1.
convert_filerefuses to write over source driftPreviously only contract errors blocked the write. A mapped source column that was missing or renamed (a sense-check
error) still produced output, with that column written blank. Now any sense-checkerroralso blocks:report["blocked"] = True,report["written"] = [], and a newreport["blocked_by"](["contract"],["sense_check"]or both). The report is still produced,render_reportstates the blocking reason(s), and the CLImainreturns 1 when blocked.2. Date-keyed FX never invents a rate
With a pinned
fx.ratestable, a row dated before every pinned rate, or with a blank/unparseable date, used to be converted silently at the earliest or latest rate. That cell is now left blank and flaggedfx_rate_unresolved(severitywarning, with row and field) inissues. Rate selection parses dates (ISO, DD MMM YYYY, dd/mm/yyyy, Excel serial, viadataclean.parse_date) instead of comparing strings. New helpers:_to_dateand_fx_resolve._fx_rateis kept as a thin wrapper._field/apply_mapgain optionalflags=/issues=, andconvert_rowsroutes those flags intoissues.3. Stale-FX sense-check parses dates
The stale-FX check compared raw strings, so
"30 Jun 2026"vs"2026-07-01"returned "not stale". Both dates are now parsed. Aratestable is judged by its latestas_of. An unparseable date gives a newfx_date_unparsedwarning instead of passing silently. The--as-ofhelp text is clarified, and the self-test is extended.4.
ingest.read_large_rows(path, sheet=None, cache_dir=None)An additive drop-in for
read_anyon big files. It returns(rows, note)in the same list-of-rows shape (header first; None/NaN/NaT become"")..xlsx/.xlsmgo throughread_large. Any other file type falls back toread_any, so it never raises just because the file is not Excel.read_largeitself stays Excel-only.Docs
data-convertSKILL.md andconversion-spec.md: defaultflag, the stale rule,--as-of/run_dates_afteron the call lines, blocking on sense-check errors, and unresolved FX left blank and flagged.data-analyse/data-tidySKILL.md andlarge-file-patterns.md: a "which reader" section coveringread_large_rowsvsread_large.Backward compatibility
error) is now blocked, and the CLI exits 1.fx.ratestill applies to every row, andfx_convertwith no pinned rate still raises.Tests
python -B -m pytest -q -p no:cacheprovider testsgives 120 passed (was 116; 4 new tests intests/test_engine.py).convert.py --self-testgivesself-test: PASS. The other engine self-tests (analyse, reconcile, viz, workbook, dataclean) are green.bin/data-lintgivesOK — plugin + 6 skills source-clean, engines self-test green.Release note
Per AGENTS.md, a version bump needs a tag and a GitHub release. After merge:
git tag v0.8.10andgh release create v0.8.10with notes from the CHANGELOG section.🤖 Generated with Claude Code