fix(bench): treat pandas as optional in correctness_precheck#16
Merged
Conversation
test_correctness_precheck_runs hard-failed with ModuleNotFoundError when
pandas was absent, taking the whole benchmark harness self-test down with it.
python_comparisons.py already treats every other comparison dependency as
optional -- _tail_sma_talib returns None on ImportError -> "not_installed",
_tail_sma_quantwave returns None -> "skipped", and _collect_versions records
"not_installed" for talib/pandas_ta. Only _tail_sma_pandas hard-imported,
making pandas the sole mandatory dep in a module built to tolerate missing
ones.
_tail_sma_pandas now returns None on ImportError and correctness_precheck
records "pandas_rolling": "not_installed", matching the talib branch exactly.
Deliberately NOT pytest.importorskip("pandas") on the test: that would skip
the entire precheck and discard the quantwave_ta correctness check -- the one
comparison that actually guards this library. The precheck now still runs and
reports quantwave_ta: ok without pandas installed.
Polars remains the reference (_tail_sma_polars), so a missing pandas costs one
cross-check, not the precheck.
tests/python/test_benchmark_harness.py: 4 passed (was 3 passed, 1 failed).
Co-Authored-By: Claude Opus 4.8 <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
test_correctness_precheck_runshard-failed withModuleNotFoundError: No module named 'pandas', taking the whole benchmark harness self-test down with it.benchmarks/python_comparisons.pyalready treats every other comparison dependency as optional:_tail_sma_talibNone→checks["talib"] = "not_installed"_tail_sma_quantwaveNone→checks["quantwave_ta"] = "skipped"_collect_versions"not_installed"fortalib/pandas_ta_tail_sma_pandasimport pandas as pd→ hard crashPandas was the sole mandatory dependency in a module built end-to-end to tolerate missing ones.
_tail_sma_pandasnow returnsNoneonImportError, andcorrectness_precheckrecords"pandas_rolling": "not_installed"— the same shape as thetalibbranch directly below it.Why not
pytest.importorskip("pandas")That was the obvious one-liner, and it's wrong. It skips the entire precheck, discarding the
quantwave_tacorrectness check — the one comparison that actually guards this library. A green-by-skipping test is exactly the kind of thingplanning/BRUTAL_REVIEW_2026-07-07.mdcalls out.Polars remains the reference (
_tail_sma_polars), so a missing pandas costs one cross-check, not the precheck. Without pandas installed, the precheck now still runs and reports:Verification
tests/python/test_benchmark_harness.py: 4 passed (was 3 passed, 1 failed)tests/python/: 180 passed. The one remaining failure (test_sma_parity) is unrelated and fixed by fix(test): repair stale test_sma_parity to use the real .ta surface (qcsn) #15; this branch is cut from main, so it still carries the stale version. With both merged: 181 passed, 0 failed.Relates to
quantwave-9gek.2(benchmark harness).🤖 Generated with Claude Code