Skip to content

Strengthen data_ends_where_expected check to scan all columns after the first - #88

Merged
dylanjmcconnell merged 1 commit into
mainfrom
strengthen-data-ends-check
Aug 19, 2026
Merged

Strengthen data_ends_where_expected check to scan all columns after the first#88
dylanjmcconnell merged 1 commit into
mainfrom
strengthen-data-ends-check

Conversation

@nick-gorman

@nick-gorman nick-gorman commented Aug 12, 2026

Copy link
Copy Markdown
Member

Summary

The data_ends_where_expected check previously inspected only the second column of the table range in the row after end_row. This missed truncated end_row configs whenever the second column happened to be blank in the dropped rows — exactly what happened with marginal_loss_factors_existing_generators in the 7.8 workbook (PR #86), where the new non-DUID generator rows have a blank second column, so 84 generators were silently dropped with green tests.

The check now scans every column from the second to the last of the table range at end_row + 1. The first column remains excluded because notes legitimately appear below it.

Validation

An empirical sweep of all 1,397 tables across workbook versions 6.0, 7.0, 7.3, 7.5 and 7.8 (branch v7.8) compared the old and new behaviour. The stricter check fires exactly twice:

  • marginal_loss_factors_existing_generators (7.8) — the genuine truncation, previously undetected (fix suggested on Config for v7.8 of IASR worksheet #86)
  • energy_efficiency_residential_green_energy_exports (6.0) — a lone stray =SUM(H30:H34) total cell in H35 below the table, i.e. a known workbook data artifact, now handled with a commented skip_checks entry

Zero other fires across all versions, so no false positives on any currently-correct config. Formula cells intentionally count as data: in the MLF case, some of the cells that betray the truncation are themselves XLOOKUP formulas.

Also renames the check's range parameter to column_range (it shadowed the builtin, and matches the config field name).

🤖 Generated with Claude Code

…he first

Previously the check only inspected the second column of the table range in
the row after end_row. This missed truncated end_row configs where the second
column happens to be blank in the dropped rows (e.g. non-DUID generators on
the Marginal Loss Factors sheet in workbook 7.8). The check now scans every
column from the second to the last of the table range; the first column
remains excluded because notes legitimately appear below it.

A sweep of all 1,397 tables across workbook versions 6.0-7.8 showed the
stricter check fires only on genuine truncations, with one known data
artifact: a stray =SUM() total cell below
energy_efficiency_residential_green_energy_exports in 6.0, now handled with
a skip_checks entry.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/isp_workbook_parser/parser.py 89.14% <100.00%> (+0.04%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dylanjmcconnell dylanjmcconnell left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks all good to me!

@dylanjmcconnell
dylanjmcconnell merged commit c95ceab into main Aug 19, 2026
18 checks passed
@dylanjmcconnell
dylanjmcconnell deleted the strengthen-data-ends-check branch August 19, 2026 23:18
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