Skip to content

Commit

Permalink
Revert PR #2027, breaks with prepost=True
Browse files Browse the repository at this point in the history
  • Loading branch information
ValueRaider committed Aug 21, 2024
1 parent 4941c61 commit 1baecc9
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions yfinance/scrapers/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,7 @@ def history(self, period="1mo", interval="1d",
# 2) fix weired bug with Yahoo! - returning 60m for 30m bars
if interval.lower() == "30m":
logger.debug(f'{self.ticker}: resampling 30m OHLC from 15m')
exchangeStartTime = pd.Timestamp(self._history_metadata["tradingPeriods"][0][0]["start"], unit='s')
offset = str(exchangeStartTime.minute % 30)+"min"
quotes2 = quotes.resample('30min', offset=offset)
quotes2 = quotes.resample('30min')
quotes = pd.DataFrame(index=quotes2.last().index, data={
'Open': quotes2['Open'].first(),
'High': quotes2['High'].max(),
Expand Down

0 comments on commit 1baecc9

Please sign in to comment.