airbyte-source-github 1.8.29__py3-none-any.whl → 1.8.29.dev202506231149__py3-none-any.whl

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: airbyte-source-github
3
- Version: 1.8.29
3
+ Version: 1.8.29.dev202506231149
4
4
  Summary: Source implementation for GitHub.
5
5
  License: MIT
6
6
  Author: Airbyte
@@ -2,7 +2,7 @@ source_github/__init__.py,sha256=punPc3v0mXEYOun7cbkfM5KUhgjv72B9DgDhI4VtzcQ,113
2
2
  source_github/backoff_strategies.py,sha256=ChkWEmqZL7Qrr1zidOfjZWlMWIVRVO2yqZ7QE_HaZP8,2287
3
3
  source_github/config_migrations.py,sha256=H58hHqAnuvb0B8IXHW4aEDZ3HotEg7HdA2rXDG9XW7A,3832
4
4
  source_github/constants.py,sha256=Hj3Q4y7OoU-Iff4m9gEC2CjwmWJYXhNbHVNjg8EBLmQ,238
5
- source_github/errors_handlers.py,sha256=sTHcazm6c7mq02IGsxnu3Naq2fkqVpnn02SHPTV1GQw,6322
5
+ source_github/errors_handlers.py,sha256=aKMf12iVtf4bnQhsST1lfgOFuauTZM7jvF8o8NzJHO8,7116
6
6
  source_github/github_schema.py,sha256=2AXmTN_s_VqvZAR1GPqus5HhSXWokS4N7HMQQqefaYw,1600315
7
7
  source_github/graphql.py,sha256=edd7EoXwD5rRDHrjm4ZBy5VGkruTScL_Xipy4CBmTFc,11625
8
8
  source_github/run.py,sha256=onA-rP2aVhWHvDquKZdR1381CU66rnzqJ7EFMS5dd4Q,407
@@ -56,9 +56,9 @@ source_github/schemas/workflow_runs.json,sha256=XDmIsjtzka-ItEonImD3ZATZjxRNkbFo
56
56
  source_github/schemas/workflows.json,sha256=gSNw8WZaVKbX4AL97PbjZHzvxcOltXqv9Ao1RNQOFXM,1470
57
57
  source_github/source.py,sha256=1o8eayigi4xSUeNHdCd-mhNswGUq_XQrVk2eihTjm1o,14246
58
58
  source_github/spec.json,sha256=7LOQm01fP_RvPF-HifhNPJ7i0AxT2LTNPaLAA3uOfNY,7443
59
- source_github/streams.py,sha256=aZLkYSHbclMGDaTskAlqKdEGHUlOUpsb_7_exONthUs,76525
59
+ source_github/streams.py,sha256=Dr1zWvKtkX4yq3THjBOx5Rkixa6Hnyso3kJ8t886gGE,76956
60
60
  source_github/utils.py,sha256=Ztd8VWwzTNUg_A96_8R9XSKorIcBa8wJ6aYUqygRkyk,5492
61
- airbyte_source_github-1.8.29.dist-info/METADATA,sha256=tL_BUQGSHHTV9j_OjoBm-prU6Qfrr9aBR0Pc3eCHag4,5202
62
- airbyte_source_github-1.8.29.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
63
- airbyte_source_github-1.8.29.dist-info/entry_points.txt,sha256=gYhqVrTAZvMwuYByg0b_-o115yUFLLcfNxMrLZmiW9k,55
64
- airbyte_source_github-1.8.29.dist-info/RECORD,,
61
+ airbyte_source_github-1.8.29.dev202506231149.dist-info/METADATA,sha256=y-a-yBgngPTljU56yBbbyaMM5dSGZ6-GYDZK22WMyFQ,5218
62
+ airbyte_source_github-1.8.29.dev202506231149.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
63
+ airbyte_source_github-1.8.29.dev202506231149.dist-info/entry_points.txt,sha256=gYhqVrTAZvMwuYByg0b_-o115yUFLLcfNxMrLZmiW9k,55
64
+ airbyte_source_github-1.8.29.dev202506231149.dist-info/RECORD,,
@@ -135,3 +135,18 @@ class GitHubGraphQLErrorHandler(GithubStreamABCErrorHandler):
135
135
  )
136
136
 
137
137
  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)
source_github/streams.py CHANGED
@@ -26,6 +26,7 @@ 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,
29
30
  ContributorActivityErrorHandler,
30
31
  GitHubGraphQLErrorHandler,
31
32
  GithubStreamABCErrorHandler,
@@ -100,6 +101,10 @@ class GithubStreamABC(HttpStream, ABC):
100
101
  stream_slice: Mapping[str, Any] = None,
101
102
  next_page_token: Mapping[str, Any] = None,
102
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
103
108
  for record in response.json(): # GitHub puts records in an array.
104
109
  yield self.transform(record=record, stream_slice=stream_slice)
105
110
 
@@ -663,6 +668,11 @@ class Commits(IncrementalMixin, GithubStream):
663
668
  self.branches_stream = Branches(**kwargs)
664
669
  self.repositories_stream = RepositoryStats(**kwargs)
665
670
 
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
+
666
676
  def request_params(self, stream_state: Mapping[str, Any], stream_slice: Mapping[str, Any] = None, **kwargs) -> MutableMapping[str, Any]:
667
677
  params = super(IncrementalMixin, self).request_params(stream_state=stream_state, stream_slice=stream_slice, **kwargs)
668
678
  since = self.get_starting_point(stream_state=stream_state, stream_slice=stream_slice)