Repository navigation
test(regression): serve the pre-1994 Q3 accession lookups from committed full-index files - #2043
Merged
Merged
Conversation
…ted full-index files The two accession lookups in the pre-1994 Q3 quarters regression test (0000003673-94-000052, a 1994 Q2 35-CERT, and 0000873611-93-000002, a 1993 Q3 24F-2NT) downloaded SEC's quarterly form indexes on every run, about 16 s on a cold cache. EFTS only indexes 2001 onward, so these lookups always fall through to the quarterly index scan, which is the path the old hardcoded 1994 Q3 start blocked. The five indexes the scan reads (1993 Q1-Q3, 1994 Q1-Q2, 670 KB gzipped) are now committed under tests/fixtures/full_index/ with a README giving each file's SHA-256. The tests serve the scan from them, treat EFTS as a miss, and assert which quarters were read. The class is now fast; the file runs in 0.16 s. Mutation-probed: restoring the 1994 Q3 start fails both lookups. 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.
What this changes
Test-only. The two end-to-end lookups in
test_issue_g00j_pre_1994q3_quarters.pyused to download SEC's quarterly form indexes on every run (about 16 s on a cold cache). EFTS only indexes 2001 onward, so these lookups always fall through to the quarterly index scan, which is the path the old hardcoded 1994 Q3 start inavailable_quarters()blocked. The test still runs that scan, but now reads the indexes from committed files instead of SEC.tests/fixtures/full_index/<year>/QTR<n>/form.gz: the five indexes the scan reads (1993 Q1-Q3, 1994 Q1-Q2), 670 KB gzipped, laid out under SEC's own paths. The README gives each file's SHA-256 (decompressed content).fast. A fixture servesdownload_textfrom those files, treats EFTS as a miss, and fails on any other URL. Each test asserts which quarters were read: 1994 Q1 then Q2, and 1993 Q1 to Q3.No changelog fragment: nothing user-visible changes.
Verification
0000003673-94-000052(ALLEGHENY POWER SYSTEM INC, 35-CERT, 1994-06-30) and0000873611-93-000002(24F-2NT, 1993-09-28), now resolved from the committed SEC indexestests/issues/regression/available_quarters()fails both lookup tests; they pass onmain-p tests._offline_harness), so it makes no network requestshatch run test-fast: 52,450 passed, 9 skipped;check-regression-provenanceOK; ruff clean on the changed fileAI assistance
🤖 Generated with Claude Code