{"record":{"id":"3e7e5e4b3a47f31d","repo":"TauricResearch/TradingAgents","slug":"no-fundamentals-returned","errorCode":null,"errorMessage":"no fundamentals returned","messagePattern":"no fundamentals returned","errorType":"exception","errorClass":"NoMarketDataError","httpStatus":null,"severity":"error","filePath":"tradingagents/dataflows/y_finance.py","lineNumber":285,"sourceCode":"            f\"Error getting stockstats indicator data for indicator {indicator} on {curr_date}: {e}\"\n        )\n        return \"\"\n\n    return str(indicator_value)\n\n\ndef get_fundamentals(\n    ticker: Annotated[str, \"ticker symbol of the company\"],\n    curr_date: Annotated[str, \"current date (not used for yfinance)\"] = None\n):\n    \"\"\"Get company fundamentals overview from yfinance.\"\"\"\n    canonical = normalize_symbol(ticker)\n    try:\n        ticker_obj = yf.Ticker(canonical)\n        info = yf_retry(lambda: ticker_obj.info)\n\n        if not info:\n            raise NoMarketDataError(ticker, canonical, \"no fundamentals returned\")\n\n        fields = [\n            (\"Name\", info.get(\"longName\")),\n            (\"Sector\", info.get(\"sector\")),\n            (\"Industry\", info.get(\"industry\")),\n            (\"Market Cap\", info.get(\"marketCap\")),\n            (\"PE Ratio (TTM)\", info.get(\"trailingPE\")),\n            (\"Forward PE\", info.get(\"forwardPE\")),\n            (\"PEG Ratio\", info.get(\"pegRatio\")),\n            (\"Price to Book\", info.get(\"priceToBook\")),\n            (\"EPS (TTM)\", info.get(\"trailingEps\")),\n            (\"Forward EPS\", info.get(\"forwardEps\")),\n            (\"Dividend Yield\", info.get(\"dividendYield\")),\n            (\"Beta\", info.get(\"beta\")),\n            (\"52 Week High\", info.get(\"fiftyTwoWeekHigh\")),\n            (\"52 Week Low\", info.get(\"fiftyTwoWeekLow\")),\n            (\"50 Day Average\", info.get(\"fiftyDayAverage\")),\n            (\"200 Day Average\", info.get(\"twoHundredDayAverage\")),","sourceCodeStart":267,"sourceCodeEnd":303,"githubUrl":"https://github.com/TauricResearch/TradingAgents/blob/a33fd4c0f134485a43553a2c23a63cb14adbd88f/tradingagents/dataflows/y_finance.py#L267-L303","documentation":"NoMarketDataError raised by get_fundamentals (y_finance.py) when yfinance's ticker.info comes back empty/None. An empty info dict means Yahoo returned no company profile — typically an unknown or delisted symbol. Raising a typed error (instead of returning prose) lets the routing layer emit one unambiguous unavailable signal.","triggerScenarios":"Calling get_fundamentals(ticker) where yf.Ticker(canonical).info is falsy — unknown ticker, delisted company, or Yahoo's profile endpoint failing. The `if not info` check fires before any field extraction.","commonSituations":"Typo'd or OTC-only symbols, recently delisted companies, Yahoo API changes/rate limiting causing empty .info payloads, or symbols valid on other data providers but not Yahoo.","solutions":["Confirm the symbol resolves on Yahoo Finance (quote page loads) before calling.","Catch NoMarketDataError and degrade gracefully — skip fundamentals analysis for that symbol.","If the symbol is valid but Yahoo is flaky, retry after a delay; persistent emptiness means the symbol is unsupported."],"exampleFix":"# before\nreport = get_fundamentals('FOOBAR')\n\n# after\nfrom tradingagents.dataflows.errors import NoMarketDataError\ntry:\n    report = get_fundamentals('FOOBAR')\nexcept NoMarketDataError:\n    report = None  # fundamentals unavailable for this symbol","handlingStrategy":"try-catch","validationCode":"import yfinance as yf\n\ndef has_fundamentals(symbol: str) -> bool:\n    info = yf.Ticker(symbol).info\n    return bool(info)","typeGuard":null,"tryCatchPattern":"from tradingagents.dataflows.errors import NoMarketDataError\n\ntry:\n    report = get_fundamentals(symbol)\nexcept NoMarketDataError:\n    report = None  # mark fundamentals unavailable; skip that analyst step","preventionTips":["Maintain a whitelist of verified tickers for automated runs.","Distinguish 'bad symbol' from 'Yahoo outage' before disabling a symbol permanently.","Route all NoMarketDataError handling through one place in your orchestration code."],"tags":["market-data","yfinance","fundamentals","ticker"],"backgroundTag":null,"analyzedSha":"a33fd4c0f134485a43553a2c23a63cb14adbd88f","analyzedAt":"2026-08-14T19:45:16.920Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}