airbyte-source-github 1.8.29__py3-none-any.whl → 1.8.29.dev202506231501__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.dev202506231501
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=wAaihlPrYqPXhso2oCubje1p8yW79ol8t2g0zgQ30Wo,7052
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=4Ucz_iCmF-Y9TfK9csIY1MpGCje_PhqhFgJOao-vNNM,77090
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.dev202506231501.dist-info/METADATA,sha256=QplCsH7P37Yw2Gv6eAUwM5cghofrdg7QDCnKVC76h-g,5218
62
+ airbyte_source_github-1.8.29.dev202506231501.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
63
+ airbyte_source_github-1.8.29.dev202506231501.dist-info/entry_points.txt,sha256=gYhqVrTAZvMwuYByg0b_-o115yUFLLcfNxMrLZmiW9k,55
64
+ airbyte_source_github-1.8.29.dev202506231501.dist-info/RECORD,,
@@ -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
 
source_github/streams.py CHANGED
@@ -29,6 +29,7 @@ from .errors_handlers import (
29
29
  ContributorActivityErrorHandler,
30
30
  GitHubGraphQLErrorHandler,
31
31
  GithubStreamABCErrorHandler,
32
+ is_conflict_with_empty_repository,
32
33
  )
33
34
  from .graphql import (
34
35
  CursorStorage,
@@ -217,6 +218,22 @@ class GithubStream(GithubStreamABC):
217
218
  record["repository"] = stream_slice["repository"]
218
219
  return record
219
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
+
220
237
 
221
238
  class SemiIncrementalMixin(CheckpointMixin):
222
239
  """