airbyte-source-github 1.8.1__py3-none-any.whl → 1.8.2__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.
- {airbyte_source_github-1.8.1.dist-info → airbyte_source_github-1.8.2.dist-info}/METADATA +3 -4
- {airbyte_source_github-1.8.1.dist-info → airbyte_source_github-1.8.2.dist-info}/RECORD +6 -6
- source_github/errors_handlers.py +9 -0
- source_github/streams.py +14 -2
- {airbyte_source_github-1.8.1.dist-info → airbyte_source_github-1.8.2.dist-info}/WHEEL +0 -0
- {airbyte_source_github-1.8.1.dist-info → airbyte_source_github-1.8.2.dist-info}/entry_points.txt +0 -0
@@ -1,18 +1,17 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: airbyte-source-github
|
3
|
-
Version: 1.8.
|
3
|
+
Version: 1.8.2
|
4
4
|
Summary: Source implementation for GitHub.
|
5
5
|
Home-page: https://airbyte.com
|
6
6
|
License: MIT
|
7
7
|
Author: Airbyte
|
8
8
|
Author-email: contact@airbyte.io
|
9
|
-
Requires-Python: >=3.
|
9
|
+
Requires-Python: >=3.10,<3.12
|
10
10
|
Classifier: License :: OSI Approved :: MIT License
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
12
|
-
Classifier: Programming Language :: Python :: 3.9
|
13
12
|
Classifier: Programming Language :: Python :: 3.10
|
14
13
|
Classifier: Programming Language :: Python :: 3.11
|
15
|
-
Requires-Dist: airbyte-cdk (>=
|
14
|
+
Requires-Dist: airbyte-cdk (>=4,<5)
|
16
15
|
Requires-Dist: sgqlc (==16.3)
|
17
16
|
Project-URL: Documentation, https://docs.airbyte.com/integrations/sources/github
|
18
17
|
Project-URL: Repository, https://github.com/airbytehq/airbyte
|
@@ -2,7 +2,7 @@ source_github/__init__.py,sha256=punPc3v0mXEYOun7cbkfM5KUhgjv72B9DgDhI4VtzcQ,113
|
|
2
2
|
source_github/backoff_strategies.py,sha256=Vo4sAhlm4A134gxCu7l9ELpnUvMP6nviIgQlHBwDJNY,2286
|
3
3
|
source_github/config_migrations.py,sha256=Dq-x0yoQNLpcO6ZwRJDfd3Mhuk4SSQDjEVfhOpto_Xc,3849
|
4
4
|
source_github/constants.py,sha256=Hj3Q4y7OoU-Iff4m9gEC2CjwmWJYXhNbHVNjg8EBLmQ,238
|
5
|
-
source_github/errors_handlers.py,sha256=
|
5
|
+
source_github/errors_handlers.py,sha256=vxbaaPfnDjky483hEuf0jkuco9hufj_jSiYqeBAgIt8,6320
|
6
6
|
source_github/github_schema.py,sha256=JHFeNATAjLjB2RvdPJks1JMrCotipLBAOnpikp30oUI,1600314
|
7
7
|
source_github/graphql.py,sha256=csp3C9Mgf5MIzShbRlb1DWffZ1qRnZzmXwmfHpfUP5U,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=tRD2GOEIJ063wFvOxn5T1hqzrYYUsA83I-sZnnM6SOc,14247
|
58
58
|
source_github/spec.json,sha256=7LOQm01fP_RvPF-HifhNPJ7i0AxT2LTNPaLAA3uOfNY,7443
|
59
|
-
source_github/streams.py,sha256=
|
59
|
+
source_github/streams.py,sha256=UdO9tE8T-sqoIuov6PIGmQwu-Uax8IJnhchca_RaZ7M,76296
|
60
60
|
source_github/utils.py,sha256=DfAHFjsF8hzDXeSCR6qtfs7W_av6o2BkkEVhtHpWbis,5462
|
61
|
-
airbyte_source_github-1.8.
|
62
|
-
airbyte_source_github-1.8.
|
63
|
-
airbyte_source_github-1.8.
|
64
|
-
airbyte_source_github-1.8.
|
61
|
+
airbyte_source_github-1.8.2.dist-info/METADATA,sha256=uOQm-MrDeU_bHEe51yPhD0S629EwsebTRRnba-sicKs,5189
|
62
|
+
airbyte_source_github-1.8.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
63
|
+
airbyte_source_github-1.8.2.dist-info/entry_points.txt,sha256=gYhqVrTAZvMwuYByg0b_-o115yUFLLcfNxMrLZmiW9k,55
|
64
|
+
airbyte_source_github-1.8.2.dist-info/RECORD,,
|
source_github/errors_handlers.py
CHANGED
@@ -90,6 +90,15 @@ class GithubStreamABCErrorHandler(HttpStatusErrorHandler):
|
|
90
90
|
|
91
91
|
|
92
92
|
class ContributorActivityErrorHandler(HttpStatusErrorHandler):
|
93
|
+
"""
|
94
|
+
This custom error handler is needed for streams based on repository statistics endpoints like ContributorActivity because
|
95
|
+
when requesting data that hasn't been cached yet when the request is made, you'll receive a 202 response. And these requests
|
96
|
+
need to retried to get the actual results.
|
97
|
+
|
98
|
+
See the docs for more info:
|
99
|
+
https://docs.github.com/en/rest/metrics/statistics?apiVersion=2022-11-28#a-word-about-caching
|
100
|
+
"""
|
101
|
+
|
93
102
|
def interpret_response(self, response_or_exception: Optional[Union[requests.Response, Exception]] = None) -> ErrorResolution:
|
94
103
|
if isinstance(response_or_exception, requests.Response) and response_or_exception.status_code == requests.codes.ACCEPTED:
|
95
104
|
return ErrorResolution(
|
source_github/streams.py
CHANGED
@@ -9,10 +9,11 @@ from urllib import parse
|
|
9
9
|
|
10
10
|
import pendulum
|
11
11
|
import requests
|
12
|
-
from airbyte_cdk import BackoffStrategy
|
12
|
+
from airbyte_cdk import BackoffStrategy, StreamSlice
|
13
13
|
from airbyte_cdk.models import AirbyteLogMessage, AirbyteMessage, Level, SyncMode
|
14
14
|
from airbyte_cdk.models import Type as MessageType
|
15
15
|
from airbyte_cdk.sources.streams.availability_strategy import AvailabilityStrategy
|
16
|
+
from airbyte_cdk.sources.streams.checkpoint.substream_resumable_full_refresh_cursor import SubstreamResumableFullRefreshCursor
|
16
17
|
from airbyte_cdk.sources.streams.core import CheckpointMixin, Stream
|
17
18
|
from airbyte_cdk.sources.streams.http import HttpStream
|
18
19
|
from airbyte_cdk.sources.streams.http.error_handlers import ErrorHandler, ErrorResolution, HttpStatusErrorHandler, ResponseAction
|
@@ -57,6 +58,9 @@ class GithubStreamABC(HttpStream, ABC):
|
|
57
58
|
self.api_url = api_url
|
58
59
|
self.state = {}
|
59
60
|
|
61
|
+
if not self.supports_incremental:
|
62
|
+
self.cursor = SubstreamResumableFullRefreshCursor()
|
63
|
+
|
60
64
|
@property
|
61
65
|
def url_base(self) -> str:
|
62
66
|
return self.api_url
|
@@ -1613,7 +1617,8 @@ class ContributorActivity(GithubStream):
|
|
1613
1617
|
return record
|
1614
1618
|
|
1615
1619
|
def get_error_handler(self) -> Optional[ErrorHandler]:
|
1616
|
-
|
1620
|
+
|
1621
|
+
return ContributorActivityErrorHandler(logger=self.logger, max_retries=5, error_mapping=GITHUB_DEFAULT_ERROR_MAPPING)
|
1617
1622
|
|
1618
1623
|
def get_backoff_strategy(self) -> Optional[Union[BackoffStrategy, List[BackoffStrategy]]]:
|
1619
1624
|
return ContributorActivityBackoffStrategy()
|
@@ -1645,6 +1650,13 @@ class ContributorActivity(GithubStream):
|
|
1645
1650
|
message=f"Syncing `{self.__class__.__name__}` " f"stream isn't available for repository `{repository}`.",
|
1646
1651
|
),
|
1647
1652
|
)
|
1653
|
+
|
1654
|
+
# In order to retain the existing stream behavior before we added RFR to this stream, we need to close out the
|
1655
|
+
# partition after we give up the maximum number of retries on the 202 response. This does lead to the question
|
1656
|
+
# of if we should prematurely exit in the first place, but for now we're going to aim for feature parity
|
1657
|
+
partition_obj = stream_slice.get("partition")
|
1658
|
+
if self.cursor and partition_obj:
|
1659
|
+
self.cursor.close_slice(StreamSlice(cursor_slice={}, partition=partition_obj))
|
1648
1660
|
else:
|
1649
1661
|
raise e
|
1650
1662
|
|
File without changes
|
{airbyte_source_github-1.8.1.dist-info → airbyte_source_github-1.8.2.dist-info}/entry_points.txt
RENAMED
File without changes
|