Skip to content

Commit

Permalink
Adds fallback on missing scopes error during schema discovery (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
vmesel authored Nov 13, 2023
1 parent 8162cb6 commit 3e6d140
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tap_hubspot_beta/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from singer_sdk.exceptions import InvalidStreamSortException
from singer_sdk.helpers.jsonpath import extract_jsonpath
from singer_sdk.exceptions import FatalAPIError

import requests
from backports.cached_property import cached_property
Expand Down Expand Up @@ -647,7 +648,11 @@ def schema(self) -> dict:
# Init request session
self._requests_session = requests.Session()
# Get the data from Hubspot
records = self.request_records(dict())
try:
records = self.request_records(dict())
except FatalAPIError:
self.logger.warning("Failed to run discover on dynamic stream ContactListsStream properties.")
records = []

properties = []
property_names = set()
Expand Down Expand Up @@ -1158,4 +1163,4 @@ class AssociationQuotesDealsStream(AssociationDealsStream):
"""Association Quotes -> Deals Stream"""

name = "associations_quotes_deals"
path = "crm/v4/associations/deals/quotes/batch/read"
path = "crm/v4/associations/deals/quotes/batch/read"

0 comments on commit 3e6d140

Please sign in to comment.