Skip to content

Fixing httpx.ReadTimeout handling in core.py - #6

Merged
dgunning merged 3 commits into
dgunning:mainfrom
linusbiostat:main
Feb 22, 2023
Merged

dgunning merged 3 commits into
dgunning:mainfrom
linusbiostat:main

Conversation

@linusbiostat

Copy link
Copy Markdown
Contributor

Hey! Congrats to this great project!
I've been getting some httpx.ReadTimeouts while trying to fetch data from the SEC. To handle these, I've added the retry wrapper from the retry package which retries after 2 seconds until the connection works. I've also added the dependency to pyproject.toml

retry after 5 seconds: useful when httpx read timeout
added retry dep
@dgunning

Copy link
Copy Markdown
Owner

Thanks for your contribution .. checking ..
Cheers!

@dgunning dgunning left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Looks fairly straightforward. Will merge and test

@dgunning
dgunning merged commit a7a8f8b into dgunning:main Feb 22, 2023
baqamisaif pushed a commit to baqamisaif/edgartools that referenced this pull request Dec 27, 2025
This commit addresses 6 priority improvements to edgar/llm.py:

- Fix Issue dgunning#1: extract_sections() now returns list when track_filtered=False
  (was incorrectly returning tuple, breaking API contract)
- Fix Issue dgunning#2: Refactor tools.llm_extraction to edgar.llm_extraction
  (moves extract_item_with_boundaries to packaged module)
- Fix Issue dgunning#3: Remove dead code _STATEMENT_KEYWORDS constant
- Fix Issue dgunning#4: Add comprehensive type hints to all private functions
- Fix Issue dgunning#5: Upgrade error messages from debug to warning level
- Fix Issue dgunning#6: Add unit tests for return type contracts

Breaking change fix: Users relying on default behavior now get list instead
of (list, {}) tuple, matching documented API contract.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
sangicook pushed a commit to sangicook/edgartools that referenced this pull request Apr 6, 2026
6 amendments from advocate/critic/deepthinker consensus (8/10 confidence):
- companies.yaml read-only during expansion (pre-populate + JSON migration)
- Per-root-cause confidence thresholds (not single 0.90)
- Archetype gap detection in /expand-cohort
- Pre-expansion override cleanup (promote industry patterns)
- Pattern detection in /investigate-gaps (3+ same-industry fixes)
- Priority queue (group gaps by metric+industry, highest leverage first)
- Success criterion dgunning#6: verified within 3 outer-loop iterations

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
dgunning added a commit that referenced this pull request Jun 21, 2026
Review follow-ups on the EX-FILING FEES consumer fixes.

#1 IPO promotion now requires an assertive 'this is an initial public
offering' phrase (new ipo_assertive signal), not the bare 'initial public
offering' substring. A 424B4 follow-on that merely references a past IPO
("since our initial public offering in 2021") no longer misclassifies as ipo;
real IPOs (verified on 3 SPAC 424B4s) still promote. The existing ipo_text
signal is untouched, so the validated firm_commitment branches are unaffected.

#4 The fee exhibit is now fetched at most once. classify_offering_type takes
an optional pre-parsed filing_fees dict; from_filing runs a text-only first
pass, and only on an inconclusive result fetches the exhibit once, reusing it
for both the classifier's structural fallback and the Prospectus424B.filing_fees
cache (seeded via the new _build_filing_fees_data helper). Well-classified
filings still pay nothing; previously the unknown tail could download twice.

#6 Dropped the dead contextRef fallback in the lxml extractor (HTML parsing
lowercases attribute names) and added Rights -> rights_offering to the
security-type mapping.

Network-free regression tests cover the assertive-phrase gating (ipo vs
follow-on vs wrong-form) and the single-fetch plumbing (injected / suppressed /
default download counts).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
dgunning added a commit that referenced this pull request Jun 24, 2026
Further review follow-ups on SECSectionExtractor (#873):

- #5 gap-fill contamination: when Item 7 has no deferred title link and the MD&A
  supplement sub-TOC can't be located, the fallback started Item 7 at the
  incorporation-by-reference pointer and spanned to the financial statements —
  dragging in the trailing items and exhibit index. Now leave Item 7 as its
  original pointer rather than emit contaminated MD&A. JPM (supplement found) is
  unaffected.

- #4 diagnosability: when the stub gates confirm an incorporation-by-reference
  Item 7 but no deferred section is classified (filer uses sub-TOC wording outside
  _DEFERRED_HEAD_MAP), log a warning instead of silently returning the stub.

- #6 _strip_leading_nav: a bare 1-4 digit line is now stripped only when it
  follows a "Table of Contents" breadcrumb; a standalone leading number is kept
  (it may be real content — a year/figure — not a page number).

- #10 test hygiene: replace the None-guarded XOM Item 16 / JPM Item 15 clamp
  assertions with hard existence asserts, so the trailing-bucket regression can't
  pass vacuously if the section goes missing.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.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.

2 participants