[PR #4517] chore: update yfinance dependency to version 0.2.40 #24556

Closed
opened 2026-02-21 20:23:14 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/4517

State: closed
Merged: Yes


Description

ERROR:root:Failed to load module core.tools.provider.builtin.yahoo.yahoo from /app/api/core/tools/provider/builtin/yahoo/yahoo.py: f-string: unmatched '[' (history.py, line 1207)
Traceback (most recent call last):
File "/app/api/core/utils/module_import_helper.py", line 29, in import_module_from_source
spec.loader.exec_module(module)
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/app/api/core/tools/provider/builtin/yahoo/yahoo.py", line 2, in
from core.tools.provider.builtin.yahoo.tools.ticker import YahooFinanceSearchTickerTool
File "/app/api/core/tools/provider/builtin/yahoo/tools/ticker.py", line 4, in
from yfinance import Ticker
File "/usr/local/lib/python3.10/site-packages/yfinance/__init__.py", line 23, in
from .ticker import Ticker
File "/usr/local/lib/python3.10/site-packages/yfinance/ticker.py", line 28, in
from .base import TickerBase
File "/usr/local/lib/python3.10/site-packages/yfinance/base.py", line 40, in
from .scrapers.history import PriceHistory
File "/usr/local/lib/python3.10/site-packages/yfinance/scrapers/history.py", line 1207
logger.debug(f'price-repair-split: Splits: {str(df['Stock Splits'][split_f].to_dict())}')
^^^^^
SyntaxError: f-string: unmatched '['
ERROR:core.tools.tool_manager:load builtin provider yahoo error: f-string: unmatched '[' (history.py, line 1207)

https://github.com/ranaroussi/yfinance/issues/1942

Fixes # (issue)

Type of Change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update, included: Dify Document
  • Improvement, including but not limited to code refactoring, performance optimization, and UI/UX improvement
  • Dependency upgrade

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • TODO

Suggested Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods
  • optional I have made corresponding changes to the documentation
  • optional I have added tests that prove my fix is effective or that my feature works
  • optional New and existing unit tests pass locally with my changes
**Original Pull Request:** https://github.com/langgenius/dify/pull/4517 **State:** closed **Merged:** Yes --- # Description ERROR:root:Failed to load module core.tools.provider.builtin.yahoo.yahoo from /app/api/core/tools/provider/builtin/yahoo/yahoo.py: f-string: unmatched '[' (history.py, line 1207) Traceback (most recent call last): File "/app/api/core/utils/module_import_helper.py", line 29, in import_module_from_source spec.loader.exec_module(module) File "<frozen importlib._bootstrap_external>", line 883, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/app/api/core/tools/provider/builtin/yahoo/yahoo.py", line 2, in <module> from core.tools.provider.builtin.yahoo.tools.ticker import YahooFinanceSearchTickerTool File "/app/api/core/tools/provider/builtin/yahoo/tools/ticker.py", line 4, in <module> from yfinance import Ticker File "/usr/local/lib/python3.10/site-packages/yfinance/__init__.py", line 23, in <module> from .ticker import Ticker File "/usr/local/lib/python3.10/site-packages/yfinance/ticker.py", line 28, in <module> from .base import TickerBase File "/usr/local/lib/python3.10/site-packages/yfinance/base.py", line 40, in <module> from .scrapers.history import PriceHistory File "/usr/local/lib/python3.10/site-packages/yfinance/scrapers/history.py", line 1207 logger.debug(f'price-repair-split: Splits: {str(df['Stock Splits'][split_f].to_dict())}') ^^^^^ SyntaxError: f-string: unmatched '[' ERROR:core.tools.tool_manager:load builtin provider yahoo error: f-string: unmatched '[' (history.py, line 1207) https://github.com/ranaroussi/yfinance/issues/1942 Fixes # (issue) ## Type of Change Please delete options that are not relevant. - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update, included: [Dify Document](https://github.com/langgenius/dify-docs) - [ ] Improvement, including but not limited to code refactoring, performance optimization, and UI/UX improvement - [ ] Dependency upgrade # How Has This Been Tested? Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration - [ ] TODO # Suggested Checklist: - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] My changes generate no new warnings - [ ] I ran `dev/reformat`(backend) and `cd web && npx lint-staged`(frontend) to appease the lint gods - [ ] `optional` I have made corresponding changes to the documentation - [ ] `optional` I have added tests that prove my fix is effective or that my feature works - [ ] `optional` New and existing unit tests pass locally with my changes
yindo added the pull-request label 2026-02-21 20:23:14 -05:00
yindo closed this issue 2026-02-21 20:23:14 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#24556