Skip to content
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
15 changes: 14 additions & 1 deletion tap_github/repository_streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from dateutil.parser import parse
from singer_sdk import typing as th # JSON Schema typing helpers
from singer_sdk.exceptions import FatalAPIError
from singer_sdk.exceptions import FatalAPIError, RetriableAPIError
from singer_sdk.helpers.jsonpath import extract_jsonpath

from tap_github.client import GitHubDiffStream, GitHubGraphqlStream, GitHubRestStream
Expand Down Expand Up @@ -3343,6 +3343,19 @@ def http_headers(self) -> dict:
headers["Accept"] = "application/vnd.github.hawkgirl-preview+json"
return headers

def get_records(self, context: Context | None) -> Iterable[dict[str, Any]]:
try:
yield from super().get_records(context)
except RetriableAPIError as e:
if "timedout" in str(e):
self.logger.warning(
"Skipping dependencies for %s/%s due to GitHub API timeout.",
context and context.get("org"),
context and context.get("repo"),
)
else:
raise

def post_process(self, row: dict, context: Context | None = None) -> dict:
"""
Add a dependency_repo_id top-level field to be used as primary key.
Expand Down
Loading