Skip to content

Commit

Permalink
Capture yahooquery FutureWarning
Browse files Browse the repository at this point in the history
Captures `FutureWarning` raised by `yahooquery` whilst fix
pending merging and release
(dpguthrie/yahooquery#262).
  • Loading branch information
maread99 committed Feb 15, 2024
1 parent 085babd commit 5edab33
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/market_prices/prices/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3764,7 +3764,7 @@ def get(
excluded. If passed, do not pass `exclude`.
exclude : list[str] | str | None
Symbol or symbols to include. All other symbols will be
Symbol or symbols to exclude. All other symbols will be
included. If passed, do not pass `include`.
side : Literal['left', 'right'] | None, default: None
Expand Down
8 changes: 8 additions & 0 deletions src/market_prices/prices/yahoo.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
ERROR404 = {"error": "HTTP 404 Not Found. Please try again"}


# TODO remove when FutureWarning fixed on yahooquery, for example if
# https://github.com/dpguthrie/yahooquery/pull/262 is merged and inlcuded to a release
warnings.filterwarnings(
"ignore", "A value is trying to be set on a copy of a DataFrame", FutureWarning
)
warnings.filterwarnings("ignore", "'S' is deprecated", FutureWarning)


class YahooAPIError(errors.APIError):
"""A Yahoo API endpoint is not available."""

Expand Down

0 comments on commit 5edab33

Please sign in to comment.