fix(research): [PR1] excise dead/dormant yfinance sites (R1/R2/R4)#197
Merged
Conversation
yfinance-centralization arc (plan: alpha-engine-docs/private/yfinance-centralization-260516.md),
PR 1 — research dead-code excision. Zero runtime behavior change (dead/dormant code
with no live consumers; the one nominal-data path R4 fed was already broken).
Deleted:
- R2: data/scanner.py::apply_balance_sheet_filter (zero callers — git grep found
only the def). Also removed the now-unused MAX_DEBT_TO_EQUITY / MIN_CURRENT_RATIO
/ BALANCE_SHEET_EXEMPT_SECTORS config imports (used only by that fn; config.py
definitions kept — signature/config-surface change is out of scope).
- R1: data/fetchers/price_fetcher.py::fetch_short_interest + `import yfinance as yf`
+ the short-interest-only telemetry (`_yf_request_count`, `get_yf_request_count`).
No live caller — scoring/aggregator.py's `short_interest_data` param is never
populated (only offline_stubs registered it). Docstring updated to state the
module is now yfinance-free.
- R4: data/fetchers/options_fetcher.py — deleted the whole module. `fetch_options_signals`
had no live caller; `cache_options_to_s3` + private helpers served only it; the
module had no live function. The two `from data.fetchers.options_fetcher import
fetch_options_data` imports in quant_tools/qual_tools referenced a symbol that
NEVER existed anywhere in the repo (verified) — i.e. get_options_flow already
had no working data path (the import raised, caught/uncaught depending on tool).
Replaced both fallback legs with the tool's existing `{"error": ...}`
graceful-degrade shape (qual_tools keeps its working S3-first path intact;
quant_tools had no S3 path). Net behavior: tools no longer raise an uncaught
ImportError under all-agents-strict — they degrade gracefully per their
documented contract; no live data path changed (there was none).
Kept (out of scope per plan): scoring/aggregator.py's inert `short_interest_data`
/ `options_data` params (removing them is a separate signature change).
Tests: no test file referenced any deleted symbol (verified). offline_stubs
registrations/stubs for the deleted symbols removed for consistency (dev-only;
the apply loop already tolerates missing targets). Full suite:
1321 passed, 1 pre-existing acceptable failure
(tests/test_scoring.py::TestRSIScoring::test_bull_overbought_matches_neutral_post_revert
— stale-local-config, passes on CI). Identical to pre-change baseline.
Zero new failures.
**DEPLOY HELD — research auto-deploys on merge; do not merge until user directs.
Part of the yfinance-centralization arc (plan doc
alpha-engine-docs/private/yfinance-centralization-260516.md); intended to land
before the held Research re-run.**
Co-Authored-By: Claude Opus 4.7 (1M context) <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.
yfinance-centralization arc — PR 1 (research dead-code excision)
Plan doc:
alpha-engine-docs/private/yfinance-centralization-260516.md(items R1, R2, R4, PR 1).Exact changes
data/scanner.py::apply_balance_sheet_filter(zero callers;git grepfound only thedef). Removed the now-unusedMAX_DEBT_TO_EQUITY/MIN_CURRENT_RATIO/BALANCE_SHEET_EXEMPT_SECTORSimports in scanner.py (used only by that fn).config.pydefinitions kept — config-surface/signature change is explicitly out of scope.data/fetchers/price_fetcher.py::fetch_short_interest+import yfinance as yf+ the short-interest-only telemetry (_yf_request_count,get_yf_request_count). No live caller —scoring/aggregator.py'sshort_interest_dataparam is never populated by any caller (only offline_stubs registered it). Module docstring updated to "yfinance-free".data/fetchers/options_fetcher.pymodule.fetch_options_signalshad no live caller;cache_options_to_s3+ private helpers served only it; the module had no live function. The twofrom data.fetchers.options_fetcher import fetch_options_dataimports inquant_tools.py/qual_tools.pyreferenced a symbol that never existed anywhere in the repo (verified) — soget_options_flowalready had no working data path. Replaced both dead fallback legs with the tool's existing{"error": ...}shape.scoring/aggregator.py's inertshort_interest_data/options_dataparams.Graceful-degrade preserved
This is a zero-runtime-behavior-change PR. The only nominal "data path" touched (R4) was already non-functional (
fetch_options_datasymbol never existed → import error).qual_tools.get_options_flowretains its working S3-first path unchanged; bothget_options_flowtools now return the tool's documented{"error": ...}degrade shape instead of raising an uncaughtImportError— strictly safer under all-agents-strict (#195), never introduces a raise where the contract degraded. No read that degraded before now raises.Tests
No test file referenced any deleted symbol (verified via
git grepovertests/). Full suitepython -m pytest tests/ -q -p no:cacheprovider: 1321 passed, 1 pre-existing acceptable failure —tests/test_scoring.py::TestRSIScoring::test_bull_overbought_matches_neutral_post_revert(stale-local-config; passes on CI). Identical to the pre-change baseline. Zero new failures.Deferred
None for this PR. R3 (balance-sheet tool) → PR2; R5 (perf-tracker fallback) → PR3.
DEPLOY HELD — research auto-deploys on merge; do not merge until user directs. Part of the yfinance-centralization arc (plan doc
alpha-engine-docs/private/yfinance-centralization-260516.md); intended to land before the held Research re-run.🤖 Generated with Claude Code