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

Deprecation warning #272

Closed
SauersML opened this issue Apr 2, 2024 · 1 comment
Closed

Deprecation warning #272

SauersML opened this issue Apr 2, 2024 · 1 comment

Comments

@SauersML
Copy link

SauersML commented Apr 2, 2024

I believe this is new. I will try to fix this.

Here is the issue:

/opt/homebrew/lib/python3.12/site-packages/yahooquery/utils/__init__.py:1470: FutureWarning: 'S' is deprecated and will be removed in a future version. Please use 's' instead of 'S'.
  has_live_indice = index_utc[-1] >= last_trade - pd.Timedelta(2, "S")
/opt/homebrew/lib/python3.12/site-packages/yahooquery/ticker.py:1333: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  df["dividends"].fillna(0, inplace=True)

The s warning comes from utils, __init__.py. The other from ticker.py.

I fixed the issue in the source code and it now runs without warning.

Pull request here: #273

@maread99
Copy link
Contributor

maread99 commented Apr 2, 2024

Hi @ScottSauers

I believe both the warnings you've noted are resolved by the PR #262, which I see you've commented on.

Please advise of any other lines that are causing any deprecation warnings (i.e. other than /utils/__init__.py:1470 and /ticker.py:1333).

Thanks

@SauersML SauersML closed this as completed Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants