Repository navigation
fix(search): drop an amendment form code whose root form is also listed - #1545
Merged
Merged
Conversation
EFTS returns amendments only as soon as forms holds an amendment code, for every form in the list, while a root code already matches its amendments. forms=["F-1", "F-1/A"] therefore returned no F-1 at all. Drop X/A when X is listed, and warn when an amendment code without its root is mixed with other forms. Fixes #1544
|
I checked the EFTS behaviour this PR relies on against a second form type, using the live endpoint on 2026-10-14 with
So the root code does match its amendments for Review points on the diff, from reading it (I did not run the suite):
|
dgunning
added a commit
that referenced
this pull request
Oct 15, 2026
…ession lookup (#1554) Opening a filing from an accession asks EDGAR full-text search first and the quarterly filing index second (edgartools-vx29). #1498 made an EFTS error body (HTTP 200, {"errorType": ...}) raise TransportError instead of reading as no hits, and resolve_accession re-raises transport errors (07lk.10). So when SEC's search backend failed on its own -- `getaddrinfo EBUSY` on 10-14 and 10-15 -- find(accession) raised for filings the index would have found. Five regression tests failed that way across #1545, #1548 and #1550. _filing_from_efts, the caller with a correct fallback, now logs a warning and returns None on a transport error, so the index is asked. resolve_accession still raises, and search_filings still raises, since there the error is the answer. If SEC itself is unreachable, the index fetch raises the same error. #1498 is unreleased, so no released version had this; no changelog fragment. 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
search_filings(..., forms=[...])no longer loses every original filing when the list contains an amendment code. EFTS returns amendments only as soon asformsholds a code likeS-1/A, for every form in the list, while a root code (S-1) already matches its amendments. The issue measured["F-1"]→ 1 filing and["F-1", "F-1/A"]→ 0 for"YHTE"._efts_forms()now builds the list sent to EFTS:X/Ais dropped whenXis also listed, so["F-1", "F-1/A"]sendsF-1and["S-1", "S-1/A", "F-1", "F-1/A", "424B4"]sendsS-1,F-1,424B4.["S-1/A"],["S-1/A", "F-1/A"]) and lists without amendments are sent unchanged.["S-1/A", "F-1"]) is still sent as given, but raises aUserWarningthat names the root form to use, because EFTS would leave out the other forms' originals.Fixes #1544
Verification
tests/issues/regression/test_issue_1544_search_forms_amendments.py, and its docstring links the issue. It stubsget_with_retry(astest_issue_1497.pydoes) and checks theformsparameter sent to EFTS for each case above, plus the warning. 4 of the 8 cases fail onmain.changelog.d/1544.fixed.md;assemble_changelog.py --checkaccepts it.tests/searchandtest_issue_1497.py(fast): 149 passed.