airbyte-source-github 1.8.17__py3-none-any.whl → 1.8.19__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.1
2
2
  Name: airbyte-source-github
3
- Version: 1.8.17
3
+ Version: 1.8.19
4
4
  Summary: Source implementation for GitHub.
5
5
  Home-page: https://airbyte.com
6
6
  License: MIT
@@ -1,10 +1,10 @@
1
1
  source_github/__init__.py,sha256=punPc3v0mXEYOun7cbkfM5KUhgjv72B9DgDhI4VtzcQ,1134
2
- source_github/backoff_strategies.py,sha256=Vo4sAhlm4A134gxCu7l9ELpnUvMP6nviIgQlHBwDJNY,2286
3
- source_github/config_migrations.py,sha256=Dq-x0yoQNLpcO6ZwRJDfd3Mhuk4SSQDjEVfhOpto_Xc,3849
2
+ source_github/backoff_strategies.py,sha256=ChkWEmqZL7Qrr1zidOfjZWlMWIVRVO2yqZ7QE_HaZP8,2287
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=vxbaaPfnDjky483hEuf0jkuco9hufj_jSiYqeBAgIt8,6320
6
- source_github/github_schema.py,sha256=JHFeNATAjLjB2RvdPJks1JMrCotipLBAOnpikp30oUI,1600314
7
- source_github/graphql.py,sha256=csp3C9Mgf5MIzShbRlb1DWffZ1qRnZzmXwmfHpfUP5U,11625
5
+ source_github/errors_handlers.py,sha256=sTHcazm6c7mq02IGsxnu3Naq2fkqVpnn02SHPTV1GQw,6322
6
+ source_github/github_schema.py,sha256=2AXmTN_s_VqvZAR1GPqus5HhSXWokS4N7HMQQqefaYw,1600315
7
+ source_github/graphql.py,sha256=edd7EoXwD5rRDHrjm4ZBy5VGkruTScL_Xipy4CBmTFc,11625
8
8
  source_github/run.py,sha256=onA-rP2aVhWHvDquKZdR1381CU66rnzqJ7EFMS5dd4Q,407
9
9
  source_github/schemas/assignees.json,sha256=_WmGIwYmTmEi9WWkvXdFF3CLsMzG2usoIjaqw-tb4NA,2335
10
10
  source_github/schemas/branches.json,sha256=3CIkdEi2XVFoVZrpO_U04mMI7-jSb9i-CT3wbIEgPik,2734
@@ -54,11 +54,11 @@ source_github/schemas/users.json,sha256=by1CEx3MW740S5F54KZfUDc2N1_UZ98Bb3fWlgCt
54
54
  source_github/schemas/workflow_jobs.json,sha256=Kk3N3FcCYBqOdR7FYvz2nAAFtLZBuVfR8Lxg-ORD39U,3934
55
55
  source_github/schemas/workflow_runs.json,sha256=XDmIsjtzka-ItEonImD3ZATZjxRNkbFo5-MPTtZDARA,19453
56
56
  source_github/schemas/workflows.json,sha256=gSNw8WZaVKbX4AL97PbjZHzvxcOltXqv9Ao1RNQOFXM,1470
57
- source_github/source.py,sha256=tRD2GOEIJ063wFvOxn5T1hqzrYYUsA83I-sZnnM6SOc,14247
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=l6Lp064UIlE4Xo6KtZjIadtuHF-jAN7YVuo6DB_lDn0,76527
60
- source_github/utils.py,sha256=DfAHFjsF8hzDXeSCR6qtfs7W_av6o2BkkEVhtHpWbis,5462
61
- airbyte_source_github-1.8.17.dist-info/METADATA,sha256=M0zsspAKOwcHigKfi0mNBYeKRhrFB3G38LYmRuPadbc,5190
62
- airbyte_source_github-1.8.17.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
63
- airbyte_source_github-1.8.17.dist-info/entry_points.txt,sha256=gYhqVrTAZvMwuYByg0b_-o115yUFLLcfNxMrLZmiW9k,55
64
- airbyte_source_github-1.8.17.dist-info/RECORD,,
59
+ source_github/streams.py,sha256=aZLkYSHbclMGDaTskAlqKdEGHUlOUpsb_7_exONthUs,76525
60
+ source_github/utils.py,sha256=Ztd8VWwzTNUg_A96_8R9XSKorIcBa8wJ6aYUqygRkyk,5492
61
+ airbyte_source_github-1.8.19.dist-info/METADATA,sha256=OlgrSwvKZ-iYuWNK1lGaOduIwk8FgCQOw4NnrQgVLAE,5190
62
+ airbyte_source_github-1.8.19.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
63
+ airbyte_source_github-1.8.19.dist-info/entry_points.txt,sha256=gYhqVrTAZvMwuYByg0b_-o115yUFLLcfNxMrLZmiW9k,55
64
+ airbyte_source_github-1.8.19.dist-info/RECORD,,
@@ -6,6 +6,7 @@ import time
6
6
  from typing import Any, Optional, Union
7
7
 
8
8
  import requests
9
+
9
10
  from airbyte_cdk import BackoffStrategy
10
11
  from airbyte_cdk.sources.streams.http import HttpStream
11
12
 
@@ -12,6 +12,7 @@ from airbyte_cdk.sources.message import InMemoryMessageRepository, MessageReposi
12
12
 
13
13
  from .source import SourceGithub
14
14
 
15
+
15
16
  logger = logging.getLogger("airbyte_logger")
16
17
 
17
18
 
@@ -30,13 +31,11 @@ class MigrateStringToArray(ABC):
30
31
 
31
32
  @property
32
33
  @abc.abstractmethod
33
- def migrate_from_key(self) -> str:
34
- ...
34
+ def migrate_from_key(self) -> str: ...
35
35
 
36
36
  @property
37
37
  @abc.abstractmethod
38
- def migrate_to_key(self) -> str:
39
- ...
38
+ def migrate_to_key(self) -> str: ...
40
39
 
41
40
  @classmethod
42
41
  def _should_migrate(cls, config: Mapping[str, Any]) -> bool:
@@ -95,12 +94,10 @@ class MigrateStringToArray(ABC):
95
94
 
96
95
 
97
96
  class MigrateRepository(MigrateStringToArray):
98
-
99
97
  migrate_from_key: str = "repository"
100
98
  migrate_to_key: str = "repositories"
101
99
 
102
100
 
103
101
  class MigrateBranch(MigrateStringToArray):
104
-
105
102
  migrate_from_key: str = "branch"
106
103
  migrate_to_key: str = "branches"
@@ -5,6 +5,7 @@
5
5
  from typing import Optional, Union
6
6
 
7
7
  import requests
8
+
8
9
  from airbyte_cdk.sources.streams.http import HttpStream
9
10
  from airbyte_cdk.sources.streams.http.error_handlers import ErrorHandler, ErrorResolution, HttpStatusErrorHandler, ResponseAction
10
11
  from airbyte_cdk.sources.streams.http.error_handlers.default_error_mapping import DEFAULT_ERROR_MAPPING
@@ -12,6 +13,7 @@ from airbyte_protocol.models import FailureType
12
13
 
13
14
  from . import constants
14
15
 
16
+
15
17
  GITHUB_DEFAULT_ERROR_MAPPING = DEFAULT_ERROR_MAPPING | {
16
18
  401: ErrorResolution(
17
19
  response_action=ResponseAction.RETRY,
@@ -6,6 +6,7 @@ import sgqlc.types
6
6
  import sgqlc.types.datetime
7
7
  import sgqlc.types.relay
8
8
 
9
+
9
10
  github_schema = sgqlc.types.Schema()
10
11
 
11
12
 
source_github/graphql.py CHANGED
@@ -11,6 +11,7 @@ from sgqlc.operation import Selector
11
11
 
12
12
  from . import github_schema
13
13
 
14
+
14
15
  _schema = github_schema
15
16
  _schema_root = _schema.github_schema
16
17
 
@@ -165,7 +166,6 @@ def get_query_issue_reactions(owner, name, first, after, number=None):
165
166
 
166
167
 
167
168
  class QueryReactions:
168
-
169
169
  # AVERAGE_REVIEWS - optimal number of reviews to fetch inside every pull request.
170
170
  # If we try to fetch too many (up to 100) we will spend too many scores of query cost.
171
171
  # https://docs.github.com/en/graphql/overview/resource-limitations#calculating-a-rate-limit-score-before-running-the-call
source_github/source.py CHANGED
@@ -60,7 +60,6 @@ from .utils import read_full_refresh
60
60
 
61
61
 
62
62
  class SourceGithub(AbstractSource):
63
-
64
63
  continue_sync_on_stream_failure = True
65
64
 
66
65
  @staticmethod
source_github/streams.py CHANGED
@@ -9,6 +9,7 @@ from urllib import parse
9
9
 
10
10
  import pendulum
11
11
  import requests
12
+
12
13
  from airbyte_cdk import BackoffStrategy, StreamSlice
13
14
  from airbyte_cdk.models import AirbyteLogMessage, AirbyteMessage, Level, SyncMode
14
15
  from airbyte_cdk.models import Type as MessageType
@@ -41,7 +42,6 @@ from .utils import GitHubAPILimitException, getter
41
42
 
42
43
 
43
44
  class GithubStreamABC(HttpStream, ABC):
44
-
45
45
  primary_key = "id"
46
46
 
47
47
  # Detect streams with high API load
@@ -80,7 +80,6 @@ class GithubStreamABC(HttpStream, ABC):
80
80
  def request_params(
81
81
  self, stream_state: Mapping[str, Any], stream_slice: Mapping[str, Any] = None, next_page_token: Mapping[str, Any] = None
82
82
  ) -> MutableMapping[str, Any]:
83
-
84
83
  params = {"per_page": self.page_size}
85
84
 
86
85
  if next_page_token:
@@ -756,7 +755,6 @@ class ReviewComments(IncrementalMixin, GithubStream):
756
755
 
757
756
 
758
757
  class GitHubGraphQLStream(GithubStream, ABC):
759
-
760
758
  http_method = "POST"
761
759
 
762
760
  def path(
@@ -976,7 +974,6 @@ class ProjectsV2(SemiIncrementalMixin, GitHubGraphQLStream):
976
974
 
977
975
 
978
976
  class ReactionStream(GithubStream, CheckpointMixin, ABC):
979
-
980
977
  parent_key = "id"
981
978
  copy_parent_key = "comment_id"
982
979
  cursor_field = "created_at"
@@ -1394,9 +1391,9 @@ class ProjectCards(GithubStream):
1394
1391
  stream_state_value = current_stream_state.get(repository, {}).get(project_id, {}).get(column_id, {}).get(self.cursor_field)
1395
1392
  if stream_state_value:
1396
1393
  updated_state = max(updated_state, stream_state_value)
1397
- current_stream_state.setdefault(repository, {}).setdefault(project_id, {}).setdefault(column_id, {})[
1398
- self.cursor_field
1399
- ] = updated_state
1394
+ current_stream_state.setdefault(repository, {}).setdefault(project_id, {}).setdefault(column_id, {})[self.cursor_field] = (
1395
+ updated_state
1396
+ )
1400
1397
  return current_stream_state
1401
1398
 
1402
1399
  def transform(self, record: MutableMapping[str, Any], stream_slice: Mapping[str, Any]) -> MutableMapping[str, Any]:
@@ -1621,7 +1618,6 @@ class ContributorActivity(GithubStream):
1621
1618
  return record
1622
1619
 
1623
1620
  def get_error_handler(self) -> Optional[ErrorHandler]:
1624
-
1625
1621
  return ContributorActivityErrorHandler(logger=self.logger, max_retries=5, error_mapping=GITHUB_DEFAULT_ERROR_MAPPING)
1626
1622
 
1627
1623
  def get_backoff_strategy(self) -> Optional[Union[BackoffStrategy, List[BackoffStrategy]]]:
source_github/utils.py CHANGED
@@ -9,6 +9,7 @@ from typing import Any, List, Mapping
9
9
 
10
10
  import pendulum
11
11
  import requests
12
+
12
13
  from airbyte_cdk.models import SyncMode
13
14
  from airbyte_cdk.sources.streams import Stream
14
15
  from airbyte_cdk.sources.streams.http.requests_native_auth import TokenAuthenticator
@@ -99,7 +100,6 @@ class MultipleTokenAuthenticatorWithRateLimiter(AbstractHeaderAuthenticator):
99
100
 
100
101
  @property
101
102
  def token(self) -> str:
102
-
103
103
  token = self.current_active_token
104
104
  return f"{self._auth_method} {token}"
105
105
 
@@ -123,13 +123,15 @@ class MultipleTokenAuthenticatorWithRateLimiter(AbstractHeaderAuthenticator):
123
123
  )
124
124
  token_info = self._tokens[token]
125
125
  remaining_info_core = rate_limit_info.get("core")
126
- token_info.count_rest, token_info.reset_at_rest = remaining_info_core.get("remaining"), pendulum.from_timestamp(
127
- remaining_info_core.get("reset")
126
+ token_info.count_rest, token_info.reset_at_rest = (
127
+ remaining_info_core.get("remaining"),
128
+ pendulum.from_timestamp(remaining_info_core.get("reset")),
128
129
  )
129
130
 
130
131
  remaining_info_graphql = rate_limit_info.get("graphql")
131
- token_info.count_graphql, token_info.reset_at_graphql = remaining_info_graphql.get("remaining"), pendulum.from_timestamp(
132
- remaining_info_graphql.get("reset")
132
+ token_info.count_graphql, token_info.reset_at_graphql = (
133
+ remaining_info_graphql.get("remaining"),
134
+ pendulum.from_timestamp(remaining_info_graphql.get("reset")),
133
135
  )
134
136
 
135
137
  def check_all_tokens(self):