airbyte-source-github 1.8.29.dev202506231149__tar.gz → 1.8.29.dev202506231501__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/PKG-INFO +1 -1
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/pyproject.toml +1 -1
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/errors_handlers.py +14 -15
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/streams.py +17 -10
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/README.md +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/__init__.py +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/backoff_strategies.py +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/config_migrations.py +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/constants.py +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/github_schema.py +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/graphql.py +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/run.py +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/assignees.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/branches.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/collaborators.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/comments.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/commit_comment_reactions.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/commit_comments.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/commits.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/contributor_activity.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/deployments.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/events.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/issue_comment_reactions.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/issue_events.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/issue_labels.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/issue_milestones.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/issue_reactions.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/issue_timeline_events.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/issues.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/organizations.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/project_cards.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/project_columns.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/projects.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/projects_v2.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/pull_request_comment_reactions.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/pull_request_commits.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/pull_request_stats.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/pull_requests.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/releases.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/repositories.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/review_comments.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/reviews.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/shared/events/comment.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/shared/events/commented.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/shared/events/committed.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/shared/events/cross_referenced.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/shared/events/reviewed.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/shared/reaction.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/shared/reactions.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/shared/user.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/shared/user_graphql.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/stargazers.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/tags.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/team_members.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/team_memberships.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/teams.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/users.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/workflow_jobs.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/workflow_runs.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/schemas/workflows.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/source.py +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/spec.json +0 -0
- {airbyte_source_github-1.8.29.dev202506231149 → airbyte_source_github-1.8.29.dev202506231501}/source_github/utils.py +0 -0
@@ -43,6 +43,13 @@ GITHUB_DEFAULT_ERROR_MAPPING = DEFAULT_ERROR_MAPPING | {
|
|
43
43
|
}
|
44
44
|
|
45
45
|
|
46
|
+
def is_conflict_with_empty_repository(response_or_exception: Optional[Union[requests.Response, Exception]] = None) -> bool:
|
47
|
+
if isinstance(response_or_exception, requests.Response) and response_or_exception.status_code == requests.codes.CONFLICT:
|
48
|
+
response_data = response_or_exception.json()
|
49
|
+
return response_data.get("message") == "Git Repository is empty."
|
50
|
+
return False
|
51
|
+
|
52
|
+
|
46
53
|
class GithubStreamABCErrorHandler(HttpStatusErrorHandler):
|
47
54
|
def __init__(self, stream: HttpStream, **kwargs): # type: ignore # noqa
|
48
55
|
self.stream = stream
|
@@ -88,6 +95,13 @@ class GithubStreamABCErrorHandler(HttpStatusErrorHandler):
|
|
88
95
|
error_message=f"Response status code: {response_or_exception.status_code}. Retrying...",
|
89
96
|
)
|
90
97
|
|
98
|
+
if is_conflict_with_empty_repository(response_or_exception=response_or_exception):
|
99
|
+
return ErrorResolution(
|
100
|
+
response_action=ResponseAction.IGNORE,
|
101
|
+
failure_type=FailureType.config_error,
|
102
|
+
error_message="Git Repository is empty.",
|
103
|
+
)
|
104
|
+
|
91
105
|
return super().interpret_response(response_or_exception)
|
92
106
|
|
93
107
|
|
@@ -135,18 +149,3 @@ class GitHubGraphQLErrorHandler(GithubStreamABCErrorHandler):
|
|
135
149
|
)
|
136
150
|
|
137
151
|
return super().interpret_response(response_or_exception)
|
138
|
-
|
139
|
-
|
140
|
-
class CommitsErrorHandler(GithubStreamABCErrorHandler):
|
141
|
-
def interpret_response(self, response_or_exception: Optional[Union[requests.Response, Exception]] = None) -> ErrorResolution:
|
142
|
-
if isinstance(response_or_exception, requests.Response):
|
143
|
-
if response_or_exception.status_code == requests.codes.CONFLICT:
|
144
|
-
response_data = response_or_exception.json()
|
145
|
-
if response_data.get("message") == "Git Repository is empty.":
|
146
|
-
return ErrorResolution(
|
147
|
-
response_action=ResponseAction.IGNORE,
|
148
|
-
failure_type=FailureType.config_error,
|
149
|
-
error_message="Git Repository is empty.",
|
150
|
-
)
|
151
|
-
|
152
|
-
return super().interpret_response(response_or_exception)
|
@@ -26,10 +26,10 @@ from . import constants
|
|
26
26
|
from .backoff_strategies import ContributorActivityBackoffStrategy, GithubStreamABCBackoffStrategy
|
27
27
|
from .errors_handlers import (
|
28
28
|
GITHUB_DEFAULT_ERROR_MAPPING,
|
29
|
-
CommitsErrorHandler,
|
30
29
|
ContributorActivityErrorHandler,
|
31
30
|
GitHubGraphQLErrorHandler,
|
32
31
|
GithubStreamABCErrorHandler,
|
32
|
+
is_conflict_with_empty_repository,
|
33
33
|
)
|
34
34
|
from .graphql import (
|
35
35
|
CursorStorage,
|
@@ -101,10 +101,6 @@ class GithubStreamABC(HttpStream, ABC):
|
|
101
101
|
stream_slice: Mapping[str, Any] = None,
|
102
102
|
next_page_token: Mapping[str, Any] = None,
|
103
103
|
) -> Iterable[Mapping]:
|
104
|
-
if response.status_code == 409:
|
105
|
-
response_data = response.json()
|
106
|
-
if response_data.get("message") == "Git Repository is empty.":
|
107
|
-
return
|
108
104
|
for record in response.json(): # GitHub puts records in an array.
|
109
105
|
yield self.transform(record=record, stream_slice=stream_slice)
|
110
106
|
|
@@ -222,6 +218,22 @@ class GithubStream(GithubStreamABC):
|
|
222
218
|
record["repository"] = stream_slice["repository"]
|
223
219
|
return record
|
224
220
|
|
221
|
+
def parse_response(
|
222
|
+
self,
|
223
|
+
response: requests.Response,
|
224
|
+
stream_state: Mapping[str, Any],
|
225
|
+
stream_slice: Mapping[str, Any] = None,
|
226
|
+
next_page_token: Mapping[str, Any] = None,
|
227
|
+
) -> Iterable[Mapping]:
|
228
|
+
if is_conflict_with_empty_repository(response):
|
229
|
+
return
|
230
|
+
yield from super().parse_response(
|
231
|
+
response=response,
|
232
|
+
stream_state=stream_state,
|
233
|
+
stream_slice=stream_slice,
|
234
|
+
next_page_token=next_page_token,
|
235
|
+
)
|
236
|
+
|
225
237
|
|
226
238
|
class SemiIncrementalMixin(CheckpointMixin):
|
227
239
|
"""
|
@@ -668,11 +680,6 @@ class Commits(IncrementalMixin, GithubStream):
|
|
668
680
|
self.branches_stream = Branches(**kwargs)
|
669
681
|
self.repositories_stream = RepositoryStats(**kwargs)
|
670
682
|
|
671
|
-
def get_error_handler(self) -> Optional[ErrorHandler]:
|
672
|
-
return CommitsErrorHandler(
|
673
|
-
logger=self.logger, max_retries=self.max_retries, error_mapping=GITHUB_DEFAULT_ERROR_MAPPING, stream=self
|
674
|
-
)
|
675
|
-
|
676
683
|
def request_params(self, stream_state: Mapping[str, Any], stream_slice: Mapping[str, Any] = None, **kwargs) -> MutableMapping[str, Any]:
|
677
684
|
params = super(IncrementalMixin, self).request_params(stream_state=stream_state, stream_slice=stream_slice, **kwargs)
|
678
685
|
since = self.get_starting_point(stream_state=stream_state, stream_slice=stream_slice)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|