Skip to content

Commit

Permalink
Fix pandas 2.2 deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
maread99 committed Feb 1, 2024
1 parent 57a73fc commit b515245
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions yahooquery/ticker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1330,9 +1330,9 @@ def _historical_data_to_dataframe(self, data, params, adj_timezone):
df = pd.DataFrame(columns=["high", "low", "volume", "open", "close"])
else:
if "dividends" in df.columns:
df["dividends"].fillna(0, inplace=True)
df.fillna({"dividends": 0}, inplace=True)
if "splits" in df.columns:
df["splits"].fillna(0, inplace=True)
df.fillna({"splites": 0}, inplace=True)
return df

def _adjust_ohlc(self, df):
Expand Down
2 changes: 1 addition & 1 deletion yahooquery/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1467,7 +1467,7 @@ def _get_daily_index(data, index_utc, adj_timezone):
has_live_indice = False
else:
last_trade = pd.Timestamp.fromtimestamp(timestamp, tz="UTC")
has_live_indice = index_utc[-1] >= last_trade - pd.Timedelta(2, "S")
has_live_indice = index_utc[-1] >= last_trade - pd.Timedelta(2, "s")
if has_live_indice:
# remove it
live_indice = index_utc[-1]
Expand Down

0 comments on commit b515245

Please sign in to comment.