Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix FutureWarnings for Pandas Compatibility and Chained Assignment #273

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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["dividends"] = df["dividends"].fillna(0)
if "splits" in df.columns:
df["splits"].fillna(0, inplace=True)
df["splits"] = df["splits"].fillna(0)
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
Loading