History returns one additional row after the end date, if time interval specified is less than 1d
History returns one additional row after the end date, if time interval specified is less than 1d
Code used:
import yfinance as yf
symbol = yf.Ticker('SPY')
symbol_history = symbol.history(start='2022-02-01', end='2022-02-03', interval='30m', action=False)
print(symbol_history)

Here you can see the last row is from 14th Feb. But the end date is 3rd Feb.
The issue is not seen, if interval is not specified, or if the interval is 1d or more. See below code and result.
symbol_history = symbol.history(start='2022-02-01', end='2022-02-03', interval='1d', action=False)

I found that adding 'adjust=False' fixes the problem
(start='2022-02-09', end='2022-02-10', interval='5m', action=False, adjust=False)
Thanks for your reply. But all of a sudden, the same code seems to be working now.
Below is the result from the same code which had issue when I posted.
symbol.history(start='2022-02-01', end='2022-02-03', interval='30m', action=False)

PR https://github.com/ranaroussi/yfinance/pull/1026 should have fixed it. Close issue if solved.