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

Unable to get history of ASIANPAINT.NS on May 4, 2022 #2044

Open
tapadeep opened this issue Sep 3, 2024 · 4 comments
Open

Unable to get history of ASIANPAINT.NS on May 4, 2022 #2044

tapadeep opened this issue Sep 3, 2024 · 4 comments

Comments

@tapadeep
Copy link

tapadeep commented Sep 3, 2024

Describe bug

My previously working script has started to throw the following error:

ERROR:yfinance:Could not get exchangeTimezoneName for ticker 'ASIANPAINT.NS' reason: 'chart'
ERROR:yfinance:$ASIANPAINT.NS: possibly delisted; no timezone found

Simple code that reproduces your problem

import yfinance as yf
import datetime as datetime0
from datetime import datetime
yf.enable_debug_mode()
yf.__version__
stock=yf.Ticker('ASIANPAINT.NS')
date=datetime.strptime('4-May-22','%d-%b-%y').date()
details=stock.history(start=date,end=date+datetime0.timedelta(days=1))

### Debug log

> DEBUG    Entering history()
DEBUG:yfinance:Entering history()
DEBUG     Entering _fetch_ticker_tz()
DEBUG:yfinance: Entering _fetch_ticker_tz()
ERROR      Could not get exchangeTimezoneName for ticker 'ASIANPAINT.NS' reason: 'chart'
ERROR:yfinance:  Could not get exchangeTimezoneName for ticker 'ASIANPAINT.NS' reason: 'chart'
DEBUG      Got response: 
DEBUG:yfinance:  Got response: 
DEBUG      -------------
DEBUG:yfinance:  -------------
DEBUG       {'finance': {'result': None, 'error': {'code': 'Internal Server Error', 'description': 'Duplicate key 1497411900'}}}
DEBUG:yfinance:   {'finance': {'result': None, 'error': {'code': 'Internal Server Error', 'description': 'Duplicate key 1497411900'}}}
DEBUG      -------------
DEBUG:yfinance:  -------------
DEBUG     Exiting _fetch_ticker_tz()
DEBUG:yfinance: Exiting _fetch_ticker_tz()
DEBUG     Entering history()
DEBUG:yfinance: Entering history()
ERROR      $ASIANPAINT.NS: possibly delisted; no timezone found
ERROR:yfinance:  $ASIANPAINT.NS: possibly delisted; no timezone found
DEBUG     Exiting history()
DEBUG:yfinance: Exiting history()
DEBUG    Exiting history()
DEBUG:yfinance:Exiting history()

### Bad data proof

![baddata_proof](https://github.com/user-attachments/assets/e7aec73d-ca58-4f16-beff-d2d0202addd8)

### `yfinance` version

0.2.43

### Python version

3.10.12

### Operating system

Ubuntu v22.04
@ValueRaider
Copy link
Collaborator

ValueRaider commented Sep 3, 2024

Your bad data proof must be from yahoo.com

@tapadeep
Copy link
Author

tapadeep commented Sep 5, 2024

Your bad data proof must be from yahoo.com
Oops, here you go..
yf_asianpaints

@ValueRaider
Copy link
Collaborator

Looking closer, May 4 is irrelevant.

DEBUG:yfinance: Entering _fetch_ticker_tz()
ERROR      Could not get exchangeTimezoneName for ticker 'ASIANPAINT.NS' reason: 'chart'

_fetch_ticker_tz is failing but only for you. Can you experiment with its code? Maybe the date range is too short. It's in base.py

@divyankm
Copy link

Today I get the same error, till yesterday it worked for same Symbol, Error, Python, Yfinance version is same.

#2052

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