Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

community: Fix YahooFinanceNewsTool to handle updated yfinance data structure #29498

Merged

Conversation

Jcasttrop
Copy link
Contributor

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

Copy link

vercel bot commented Jan 30, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Jan 31, 2025 2:27am

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. community Related to langchain-community 🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature labels Jan 30, 2025
Copy link
Collaborator

@ccurme ccurme left a comment

Choose a reason for hiding this comment

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

Thanks!

@dosubot dosubot bot added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label Jan 31, 2025
@ccurme ccurme enabled auto-merge (squash) January 31, 2025 02:27
@ccurme ccurme merged commit b7e3e33 into langchain-ai:master Jan 31, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature community Related to langchain-community lgtm PR looks good. Use to confirm that a PR is ready for merging. size:S This PR changes 10-29 lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants