Yahoo Finance Analysis Plugin not working #101

Closed
opened 2026-02-16 10:18:04 -05:00 by yindo · 1 comment
Owner

Originally created by @rishabh-dream11 on GitHub (Mar 20, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.1.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. Use the template Investment analyst report copilot
  2. choose a relevant model.
  3. Ask for a fundamental analysis on any stock, say Amazon, which should result in the LLM using tools like Yahoo Tracker, Yahoo Analysis, and Yahoo News.
  4. It Turns out the Yahoo tracker is working, but Yahoo analysis is breaking.
    See the
Image

image for reference.

✔️ Expected Behavior

Should work Flawlessly for any compatible model

Actual Behavior

Request
{"yahoo_finance_analytics": {"symbol": "AMZN", "start_date": "2023-01-01", "end_date": "2024-03-17"}}

Response
{"yahoo_finance_analytics": "tool invoke error: PluginInvokeError: {"args":{},"error_type":"KeyError","message":"'Adj Close'"}"}

Originally created by @rishabh-dream11 on GitHub (Mar 20, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.1.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 1. Use the template Investment analyst report copilot 2. choose a relevant model. 3. Ask for a fundamental analysis on any stock, say Amazon, which should result in the LLM using tools like Yahoo Tracker, Yahoo Analysis, and Yahoo News. 4. It Turns out the Yahoo tracker is working, but Yahoo analysis is breaking. See the <img width="1400" alt="Image" src="https://github.com/user-attachments/assets/d3e6465b-23e2-40c0-a461-b582dfef3823" /> image for reference. ### ✔️ Expected Behavior Should work Flawlessly for any compatible model ### ❌ Actual Behavior Request {"yahoo_finance_analytics": {"symbol": "AMZN", "start_date": "2023-01-01", "end_date": "2024-03-17"}} Response {"yahoo_finance_analytics": "tool invoke error: PluginInvokeError: {\"args\":{},\"error_type\":\"KeyError\",\"message\":\"'Adj Close'\"}"}
yindo closed this issue 2026-02-16 10:18:04 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Mar 20, 2025):

Hey @rishabh-dream11! 👋 I'm here to help you with bug fixes, answer your questions, and assist you while you wait for a human maintainer. Let's squash those bugs together!

The issue you're encountering with the Yahoo Finance Analysis Plugin seems to be related to a KeyError for the 'Adj Close' field. This error typically occurs when the expected 'Adj Close' field is missing from the data returned by the Yahoo Finance API.

Here are a few steps you can take to troubleshoot and potentially resolve this issue:

  1. Verify Data Availability: Ensure that the 'Adj Close' data is available for the stock symbol and date range you are querying. Sometimes, the data might not be available for certain stocks or date ranges.

  2. Check Data Fetching Logic: Review the code that fetches data from Yahoo Finance to ensure it correctly handles cases where 'Adj Close' might be missing. You might need to add error handling to manage such cases gracefully.

  3. Update Dependencies: Ensure that all dependencies, especially the yfinance library, are up to date. There might be updates or bug fixes that address this issue.

  4. Debugging: Add logging or print statements to check the structure of the data being returned before accessing the 'Adj Close' field. This can help identify if the data is being fetched correctly.

If these steps do not resolve the issue, you might need to delve deeper into the plugin's code to handle cases where 'Adj Close' is not present in the data.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Mar 20, 2025): <!-- Greeting --> Hey @rishabh-dream11! 👋 I'm here to help you with bug fixes, answer your questions, and assist you while you wait for a human maintainer. Let's squash those bugs together! <!-- Answer --> The issue you're encountering with the Yahoo Finance Analysis Plugin seems to be related to a `KeyError` for the 'Adj Close' field. This error typically occurs when the expected 'Adj Close' field is missing from the data returned by the Yahoo Finance API. Here are a few steps you can take to troubleshoot and potentially resolve this issue: 1. **Verify Data Availability**: Ensure that the 'Adj Close' data is available for the stock symbol and date range you are querying. Sometimes, the data might not be available for certain stocks or date ranges. 2. **Check Data Fetching Logic**: Review the code that fetches data from Yahoo Finance to ensure it correctly handles cases where 'Adj Close' might be missing. You might need to add error handling to manage such cases gracefully. 3. **Update Dependencies**: Ensure that all dependencies, especially the `yfinance` library, are up to date. There might be updates or bug fixes that address this issue. 4. **Debugging**: Add logging or print statements to check the structure of the data being returned before accessing the 'Adj Close' field. This can help identify if the data is being fetched correctly. If these steps do not resolve the issue, you might need to delve deeper into the plugin's code to handle cases where 'Adj Close' is not present in the data. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/d8982629-5dd8-43d7-994a-58d0d2090941?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/d8982629-5dd8-43d7-994a-58d0d2090941?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/d8982629-5dd8-43d7-994a-58d0d2090941?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/d8982629-5dd8-43d7-994a-58d0d2090941?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/d8982629-5dd8-43d7-994a-58d0d2090941?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/d8982629-5dd8-43d7-994a-58d0d2090941?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/d8982629-5dd8-43d7-994a-58d0d2090941?feedback_type=other)</sup>
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#101