langchain/libs/community/tests/integration_tests/tools
Julian Castro Pulgarin b7e3e337b1
community: Fix YahooFinanceNewsTool to handle updated yfinance data structure (#29498)
*Description:**
Updates the YahooFinanceNewsTool to handle the current yfinance news
data structure. The tool was failing with a KeyError due to changes in
the yfinance API's response format. This PR updates the code to
correctly extract news URLs from the new structure.

**Issue:** #29495

**Dependencies:** 
No new dependencies required. Works with existing yfinance package.

The changes maintain backwards compatibility while fixing the KeyError
that users were experiencing.

The modified code properly handles the new data structure where:
- News type is now at `content.contentType`
- News URL is now at `content.canonicalUrl.url`

---------

Co-authored-by: Chester Curme <chester.curme@gmail.com>
2025-01-31 02:31:44 +00:00
..
connery infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
edenai infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
nuclia community[patch]: Add missing annotations (#24890) 2024-07-31 18:13:44 +00:00
zenguard docs: Spell check fixes (#24217) 2024-07-15 15:51:43 +00:00
__init__.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00
test_yahoo_finance_news.py community: Fix YahooFinanceNewsTool to handle updated yfinance data structure (#29498) 2025-01-31 02:31:44 +00:00