Skip to content

Commit b515245

Browse files
committed
Fix pandas 2.2 deprecation warnings
1 parent 57a73fc commit b515245

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

yahooquery/ticker.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1330,9 +1330,9 @@ def _historical_data_to_dataframe(self, data, params, adj_timezone):
13301330
df = pd.DataFrame(columns=["high", "low", "volume", "open", "close"])
13311331
else:
13321332
if "dividends" in df.columns:
1333-
df["dividends"].fillna(0, inplace=True)
1333+
df.fillna({"dividends": 0}, inplace=True)
13341334
if "splits" in df.columns:
1335-
df["splits"].fillna(0, inplace=True)
1335+
df.fillna({"splites": 0}, inplace=True)
13361336
return df
13371337

13381338
def _adjust_ohlc(self, df):

yahooquery/utils/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1467,7 +1467,7 @@ def _get_daily_index(data, index_utc, adj_timezone):
14671467
has_live_indice = False
14681468
else:
14691469
last_trade = pd.Timestamp.fromtimestamp(timestamp, tz="UTC")
1470-
has_live_indice = index_utc[-1] >= last_trade - pd.Timedelta(2, "S")
1470+
has_live_indice = index_utc[-1] >= last_trade - pd.Timedelta(2, "s")
14711471
if has_live_indice:
14721472
# remove it
14731473
live_indice = index_utc[-1]

0 commit comments

Comments
 (0)