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

0.2.39 introduces issues with repair #1943

Closed
darth-veitcher opened this issue May 19, 2024 · 2 comments
Closed

0.2.39 introduces issues with repair #1943

darth-veitcher opened this issue May 19, 2024 · 2 comments

Comments

@darth-veitcher
Copy link

Describe bug

Attempting to import package after installation with yfinance[nospam,repair] gives the following exception.

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 '['

Simple code that reproduces your problem

python -m venv venv
source venv/bin/activate
python -m pip install "yfinance[nospam,repair]"
python -c 'import yfinance as yf;'

Debug log

➜ python -c 'import yfinance as yf;'                                 
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/private/tmp/venv/lib/python3.10/site-packages/yfinance/__init__.py", line 23, in <module>
    from .ticker import Ticker
  File "/private/tmp/venv/lib/python3.10/site-packages/yfinance/ticker.py", line 28, in <module>
    from .base import TickerBase
  File "/private/tmp/venv/lib/python3.10/site-packages/yfinance/base.py", line 40, in <module>
    from .scrapers.history import PriceHistory
  File "/private/tmp/venv/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 '['

Bad data proof

No response

yfinance version

0.2.39

Python version

Python 3.10.12

Operating system

MacOS

@eric-stanley
Copy link

Tested and encountered the same issue

yfinance version
0.2.39

Python version
Python 3.11

Operating system
Pop OS

@ValueRaider
Copy link
Collaborator

Duplicate of #1942

@ValueRaider ValueRaider marked this as a duplicate of #1942 May 19, 2024
@ValueRaider ValueRaider closed this as not planned Won't fix, can't repro, duplicate, stale May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants