Closed wally2511 closed 1 week ago
Pulling stock data using versions 0.2.42 and onwards fails to pull the last trading days data for ASX stocks. This could be related to timezones but the issue doesn't exist in 0.2.41.
stock_data_daily = yf.download('CSL.AX', period='1y', interval='1d')
DEBUG Entering download() DEBUG:yfinance:Entering download() DEBUG Disabling multithreading because DEBUG logging enabled DEBUG:yfinance: Disabling multithreading because DEBUG logging enabled DEBUG Entering history() DEBUG:yfinance: Entering history() DEBUG Entering history() DEBUG:yfinance: Entering history() DEBUG CSL.AX: Yahoo GET parameters: {'range': '1y', 'interval': '1d', 'includePrePost': False, 'events': 'div,splits,capitalGains'} DEBUG:yfinance: CSL.AX: Yahoo GET parameters: {'range': '1y', 'interval': '1d', 'includePrePost': False, 'events': 'div,splits,capitalGains'} DEBUG Entering get() DEBUG:yfinance: Entering get() DEBUG url=https://query2.finance.yahoo.com/v8/finance/chart/CSL.AX DEBUG:yfinance: url=https://query2.finance.yahoo.com/v8/finance/chart/CSL.AX DEBUG params={'range': '1y', 'interval': '1d', 'includePrePost': False, 'events': 'div,splits,capitalGains'} DEBUG:yfinance: params={'range': '1y', 'interval': '1d', 'includePrePost': False, 'events': 'div,splits,capitalGains'} DEBUG Entering _get_cookie_and_crumb() DEBUG:yfinance: Entering _get_cookie_and_crumb() DEBUG cookie_mode = 'basic' DEBUG:yfinance: cookie_mode = 'basic' DEBUG Entering _get_cookie_and_crumb_basic() DEBUG:yfinance: Entering _get_cookie_and_crumb_basic() DEBUG reusing cookie DEBUG:yfinance: reusing cookie DEBUG reusing crumb DEBUG:yfinance: reusing crumb DEBUG Exiting _get_cookie_and_crumb_basic() DEBUG:yfinance: Exiting _get_cookie_and_crumb_basic() DEBUG Exiting _get_cookie_and_crumb() DEBUG:yfinance: Exiting _get_cookie_and_crumb() DEBUG response code=200 DEBUG:yfinance: response code=200 DEBUG Exiting get() DEBUG:yfinance: Exiting get() DEBUG CSL.AX: yfinance received OHLC data: 2023-11-07 23:00:00 -> 2024-11-08 05:10:12 DEBUG:yfinance: CSL.AX: yfinance received OHLC data: 2023-11-07 23:00:00 -> 2024-11-08 05:10:12 DEBUG CSL.AX: OHLC after cleaning: 2023-11-08 10:00:00+11:00 -> 2024-11-08 16:10:12+11:00 DEBUG:yfinance: CSL.AX: OHLC after cleaning: 2023-11-08 10:00:00+11:00 -> 2024-11-08 16:10:12+11:00 DEBUG CSL.AX: OHLC after combining events: 2023-11-08 00:00:00+11:00 -> 2024-11-08 00:00:00+11:00 DEBUG:yfinance: CSL.AX: OHLC after combining events: 2023-11-08 00:00:00+11:00 -> 2024-11-08 00:00:00+11:00 DEBUG CSL.AX: yfinance returning OHLC: 2023-11-08 00:00:00+11:00 -> 2024-11-07 00:00:00+11:00 DEBUG:yfinance: CSL.AX: yfinance returning OHLC: 2023-11-08 00:00:00+11:00 -> 2024-11-07 00:00:00+11:00 DEBUG Exiting history() DEBUG:yfinance: Exiting history() DEBUG Exiting history() DEBUG:yfinance: Exiting history() DEBUG Exiting download() DEBUG:yfinance:Exiting download()
No response
yfinance
= 0.2.42
Thanks for report, that bug been present a long time. Only happens when Yahoo duplicates last 1d interval
Describe bug
Pulling stock data using versions 0.2.42 and onwards fails to pull the last trading days data for ASX stocks. This could be related to timezones but the issue doesn't exist in 0.2.41.
Simple code that reproduces your problem
stock_data_daily = yf.download('CSL.AX', period='1y', interval='1d')
Debug log
DEBUG Entering download() DEBUG:yfinance:Entering download() DEBUG Disabling multithreading because DEBUG logging enabled DEBUG:yfinance: Disabling multithreading because DEBUG logging enabled DEBUG Entering history() DEBUG:yfinance: Entering history() DEBUG Entering history() DEBUG:yfinance: Entering history() DEBUG CSL.AX: Yahoo GET parameters: {'range': '1y', 'interval': '1d', 'includePrePost': False, 'events': 'div,splits,capitalGains'} DEBUG:yfinance: CSL.AX: Yahoo GET parameters: {'range': '1y', 'interval': '1d', 'includePrePost': False, 'events': 'div,splits,capitalGains'} DEBUG Entering get() DEBUG:yfinance: Entering get() DEBUG url=https://query2.finance.yahoo.com/v8/finance/chart/CSL.AX DEBUG:yfinance: url=https://query2.finance.yahoo.com/v8/finance/chart/CSL.AX DEBUG params={'range': '1y', 'interval': '1d', 'includePrePost': False, 'events': 'div,splits,capitalGains'} DEBUG:yfinance: params={'range': '1y', 'interval': '1d', 'includePrePost': False, 'events': 'div,splits,capitalGains'} DEBUG Entering _get_cookie_and_crumb() DEBUG:yfinance: Entering _get_cookie_and_crumb() DEBUG cookie_mode = 'basic' DEBUG:yfinance: cookie_mode = 'basic' DEBUG Entering _get_cookie_and_crumb_basic() DEBUG:yfinance: Entering _get_cookie_and_crumb_basic() DEBUG reusing cookie DEBUG:yfinance: reusing cookie DEBUG reusing crumb DEBUG:yfinance: reusing crumb DEBUG Exiting _get_cookie_and_crumb_basic() DEBUG:yfinance: Exiting _get_cookie_and_crumb_basic() DEBUG Exiting _get_cookie_and_crumb() DEBUG:yfinance: Exiting _get_cookie_and_crumb() DEBUG response code=200 DEBUG:yfinance: response code=200 DEBUG Exiting get() DEBUG:yfinance: Exiting get() DEBUG CSL.AX: yfinance received OHLC data: 2023-11-07 23:00:00 -> 2024-11-08 05:10:12 DEBUG:yfinance: CSL.AX: yfinance received OHLC data: 2023-11-07 23:00:00 -> 2024-11-08 05:10:12 DEBUG CSL.AX: OHLC after cleaning: 2023-11-08 10:00:00+11:00 -> 2024-11-08 16:10:12+11:00 DEBUG:yfinance: CSL.AX: OHLC after cleaning: 2023-11-08 10:00:00+11:00 -> 2024-11-08 16:10:12+11:00 DEBUG CSL.AX: OHLC after combining events: 2023-11-08 00:00:00+11:00 -> 2024-11-08 00:00:00+11:00 DEBUG:yfinance: CSL.AX: OHLC after combining events: 2023-11-08 00:00:00+11:00 -> 2024-11-08 00:00:00+11:00 DEBUG CSL.AX: yfinance returning OHLC: 2023-11-08 00:00:00+11:00 -> 2024-11-07 00:00:00+11:00 DEBUG:yfinance: CSL.AX: yfinance returning OHLC: 2023-11-08 00:00:00+11:00 -> 2024-11-07 00:00:00+11:00 DEBUG Exiting history() DEBUG:yfinance: Exiting history() DEBUG Exiting history() DEBUG:yfinance: Exiting history() DEBUG Exiting download() DEBUG:yfinance:Exiting download()
Bad data proof
No response
yfinance
versionPython version
No response
Operating system
No response