diff --git a/libs/community/langchain_community/utilities/polygon.py b/libs/community/langchain_community/utilities/polygon.py index c7ab49f405467..f14069bd4fa61 100644 --- a/libs/community/langchain_community/utilities/polygon.py +++ b/libs/community/langchain_community/utilities/polygon.py @@ -45,7 +45,7 @@ def get_financials(self, ticker: str) -> Optional[dict]: data = response.json() status = data.get("status", None) - if status not in ("OK", "STOCKBUSINESS"): + if status not in ("OK", "STOCKBUSINESS", "STOCKSBUSINESS"): raise ValueError(f"API Error: {data}") return data.get("results", None) @@ -61,7 +61,7 @@ def get_last_quote(self, ticker: str) -> Optional[dict]: data = response.json() status = data.get("status", None) - if status not in ("OK", "STOCKBUSINESS"): + if status not in ("OK", "STOCKBUSINESS", "STOCKSBUSINESS"): raise ValueError(f"API Error: {data}") return data.get("results", None) @@ -82,7 +82,7 @@ def get_ticker_news(self, ticker: str) -> Optional[dict]: data = response.json() status = data.get("status", None) - if status not in ("OK", "STOCKBUSINESS"): + if status not in ("OK", "STOCKBUSINESS", "STOCKSBUSINESS"): raise ValueError(f"API Error: {data}") return data.get("results", None) @@ -116,7 +116,7 @@ def get_aggregates(self, ticker: str, **kwargs: Any) -> Optional[dict]: data = response.json() status = data.get("status", None) - if status not in ("OK", "STOCKBUSINESS"): + if status not in ("OK", "STOCKBUSINESS", "STOCKSBUSINESS"): raise ValueError(f"API Error: {data}") return data.get("results", None)