Skip to content

fix: locate a workbook cell that does not fit a reading among its outliers - #194

Merged
vaceslav merged 1 commit into
mainfrom
fix/locate-native-cells-a-reading-misses
Nov 17, 2026
Merged

vaceslav merged 1 commit into
mainfrom
fix/locate-native-cells-a-reading-misses

Conversation

@vaceslav

Copy link
Copy Markdown
Contributor

TypeHypothesis.Outliers promises where the values a reading does not account for stand. For a cell whose type the workbook states, that promise was not kept. A number in a column of xlsx or ods dates, for example Excel's phantom 29 February 1900, which reads as its number since #189, was counted in UnmatchedCount, but no outlier gave its row. The profiler located only text cells that failed to parse. Native cells went to AcceptNativeNumber/AcceptNativeDate and were never located for the readings they did not fit. In a column the file declared entirely, HypothesisBuilder also passed empty outlier lists. Noticed while fixing serial 60 for #184.

What changes:

  • ColumnProfiler, for each culture:
    • a native number is a date outlier;
    • a native date is a numeric outlier;
    • a native boolean is both;
    • each is recorded with its row and text, up to OutlierSampleSize, in row order with the text cells.
  • HypothesisBuilder.AddDeclared passes the date and numeric outliers to the date and number readings instead of empty lists.

This also helps mixed columns of text and native cells. Their parsed readings now list the native cells that do not fit as well.

Cost: one count comparison per culture for each native cell, once the first OutlierSampleSize are taken. Benchmark: see the comment below.

Tests in ColumnProfilerTests:

  • dates with a number and a boolean list the right rows for both readings, and the date hypothesis lists them too;
  • the outlier limit holds.

@vaceslav

Copy link
Copy Markdown
Contributor Author

Benchmark on a Hetzner ccx33 (benchmarks/cloud/remote/refs.sh, base = main, head = this branch). No change beyond the ±3% noise floor; allocations and peaks unchanged.

measurement base spread head spread vs base allocated, peak
workbook-100k.xlsx / TriasDev.Tabular.XlsxCursor 778 ms 13.8% 774 ms 12.0% -0.5% base: 43 MB, 62 MB · head: 43 MB, 64 MB
workbook-100k.xlsx / TriasDev.Tabular.XlsxCursor (cells only) 490 ms 5.9% 490 ms 4.7% +0.0% base: 15 MB, 62 MB · head: 15 MB, 62 MB
workbook-100k.xlsx / Full analysis (xlsx) 1,001 ms 4.3% 991 ms 17.0% -1.0% base: 58 MB, 81 MB · head: 58 MB, 81 MB
workbook-1m.xlsx / TriasDev.Tabular.XlsxCursor 3,460 ms 3.2% 3,454 ms 2.8% -0.2% base: 427 MB, 64 MB · head: 427 MB, 64 MB
workbook-1m.xlsx / TriasDev.Tabular.XlsxCursor (cells only) 2,649 ms 2.4% 2,634 ms 9.1% -0.6% base: 146 MB, 64 MB · head: 146 MB, 64 MB
workbook-1m.xlsx / Full analysis (xlsx) 5,505 ms 10.1% 5,424 ms 4.1% -1.5% base: 500 MB, 139 MB · head: 500 MB, 140 MB
clean-3m.csv / TriasDev.Tabular.CsvCursor 1,740 ms 4.6% 1,717 ms 2.2% -1.3% base: 1,695 MB, 56 MB · head: 1,695 MB, 56 MB
clean-3m.csv / Full analysis (csv) 8,120 ms 7.4% 8,156 ms 3.9% +0.4% base: 1,799 MB, 162 MB · head: 1,799 MB, 163 MB
malformed-5m.csv / TriasDev.Tabular.CsvCursor 2,835 ms 10.0% 2,820 ms 1.5% -0.5% base: 2,898 MB, 57 MB · head: 2,898 MB, 57 MB
malformed-5m.csv / Full analysis (csv) 13,355 ms 8.4% 13,147 ms 6.4% -1.6% base: 3,002 MB, 162 MB · head: 3,002 MB, 163 MB

@vaceslav
vaceslav merged commit 7ebcfbc into main Nov 17, 2026
10 checks passed
@vaceslav
vaceslav deleted the fix/locate-native-cells-a-reading-misses branch November 17, 2026 19:10
vaceslav added a commit that referenced this pull request Nov 18, 2026
🤖 I have created a release *beep* *boop*
---


## [0.8.3](v0.8.2...v0.8.3)
(2026-11-17)


### Bug Fixes

* count dates written with a multi-character date separator as the
culture's own ([#186](#186))
([fc8b11f](fc8b11f))
* count each ods sheet's repeats once against MaxRepeatedCells, so
reading a sheet again is not refused
([#187](#187))
([b450d4a](b450d4a))
* locate a workbook cell that does not fit a reading among its outliers
([#194](#194))
([7ebcfbc](7ebcfbc))
* read an ods duration of one to fifty-nine days on the day LibreOffice
shows, not a day later
([#193](#193))
([a7145d3](a7145d3))
* read Excel's phantom 29 February 1900 as no date, a cell without a
style as style 0, and character references of any length
([#189](#189))
([e4008fa](e4008fa))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Slava <vaceslav@users.noreply.github.com>
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.

1 participant