Skip to content

The agent engineering platform.

community: Update Polygon.io API (#27552)

W. Gustavo Cevallosf94125a32530
diff --git a/libs/community/langchain_community/utilities/polygon.py b/libs/community/langchain_community/utilities/polygon.py
index c7ab49f405..f14069bd4f 100644
--- a/libs/community/langchain_community/utilities/polygon.py
+++ b/libs/community/langchain_community/utilities/polygon.py
@@ -45,7 +45,7 @@ class PolygonAPIWrapper(BaseModel):
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 @@ class PolygonAPIWrapper(BaseModel):
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 @@ class PolygonAPIWrapper(BaseModel):
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 @@ class PolygonAPIWrapper(BaseModel):
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)