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

community[patch]: polygon: support business subscription #25085

Merged
merged 4 commits into from
Aug 8, 2024
Merged
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
8 changes: 4 additions & 4 deletions libs/community/langchain_community/utilities/polygon.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def get_financials(self, ticker: str) -> Optional[dict]:
data = response.json()

status = data.get("status", None)
if status != "OK":
if status not in ("OK", "STOCKBUSINESS"):
raise ValueError(f"API Error: {data}")

return data.get("results", None)
Expand All @@ -60,7 +60,7 @@ def get_last_quote(self, ticker: str) -> Optional[dict]:
data = response.json()

status = data.get("status", None)
if status != "OK":
if status not in ("OK", "STOCKBUSINESS"):
raise ValueError(f"API Error: {data}")

return data.get("results", None)
Expand All @@ -81,7 +81,7 @@ def get_ticker_news(self, ticker: str) -> Optional[dict]:
data = response.json()

status = data.get("status", None)
if status != "OK":
if status not in ("OK", "STOCKBUSINESS"):
raise ValueError(f"API Error: {data}")

return data.get("results", None)
Expand Down Expand Up @@ -115,7 +115,7 @@ def get_aggregates(self, ticker: str, **kwargs: Any) -> Optional[dict]:
data = response.json()

status = data.get("status", None)
if status != "OK":
if status not in ("OK", "STOCKBUSINESS"):
raise ValueError(f"API Error: {data}")

return data.get("results", None)
Expand Down
Loading