airbyte-source-github 1.7.6__tar.gz → 1.7.8__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.
Files changed (61) hide show
  1. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/PKG-INFO +2 -2
  2. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/pyproject.toml +2 -2
  3. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/streams.py +29 -7
  4. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/README.md +0 -0
  5. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/__init__.py +0 -0
  6. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/config_migrations.py +0 -0
  7. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/constants.py +0 -0
  8. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/github_schema.py +0 -0
  9. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/graphql.py +0 -0
  10. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/run.py +0 -0
  11. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/assignees.json +0 -0
  12. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/branches.json +0 -0
  13. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/collaborators.json +0 -0
  14. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/comments.json +0 -0
  15. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/commit_comment_reactions.json +0 -0
  16. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/commit_comments.json +0 -0
  17. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/commits.json +0 -0
  18. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/contributor_activity.json +0 -0
  19. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/deployments.json +0 -0
  20. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/events.json +0 -0
  21. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/issue_comment_reactions.json +0 -0
  22. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/issue_events.json +0 -0
  23. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/issue_labels.json +0 -0
  24. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/issue_milestones.json +0 -0
  25. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/issue_reactions.json +0 -0
  26. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/issue_timeline_events.json +0 -0
  27. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/issues.json +0 -0
  28. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/organizations.json +0 -0
  29. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/project_cards.json +0 -0
  30. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/project_columns.json +0 -0
  31. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/projects.json +0 -0
  32. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/projects_v2.json +0 -0
  33. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/pull_request_comment_reactions.json +0 -0
  34. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/pull_request_commits.json +0 -0
  35. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/pull_request_stats.json +0 -0
  36. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/pull_requests.json +0 -0
  37. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/releases.json +0 -0
  38. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/repositories.json +0 -0
  39. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/review_comments.json +0 -0
  40. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/reviews.json +0 -0
  41. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/shared/events/comment.json +0 -0
  42. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/shared/events/commented.json +0 -0
  43. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/shared/events/committed.json +0 -0
  44. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/shared/events/cross_referenced.json +0 -0
  45. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/shared/events/reviewed.json +0 -0
  46. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/shared/reaction.json +0 -0
  47. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/shared/reactions.json +0 -0
  48. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/shared/user.json +0 -0
  49. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/shared/user_graphql.json +0 -0
  50. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/stargazers.json +0 -0
  51. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/tags.json +0 -0
  52. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/team_members.json +0 -0
  53. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/team_memberships.json +0 -0
  54. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/teams.json +0 -0
  55. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/users.json +0 -0
  56. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/workflow_jobs.json +0 -0
  57. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/workflow_runs.json +0 -0
  58. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/schemas/workflows.json +0 -0
  59. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/source.py +0 -0
  60. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/spec.json +0 -0
  61. {airbyte_source_github-1.7.6 → airbyte_source_github-1.7.8}/source_github/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: airbyte-source-github
3
- Version: 1.7.6
3
+ Version: 1.7.8
4
4
  Summary: Source implementation for GitHub.
5
5
  Home-page: https://airbyte.com
6
6
  License: MIT
@@ -12,7 +12,7 @@ Classifier: Programming Language :: Python :: 3
12
12
  Classifier: Programming Language :: Python :: 3.9
13
13
  Classifier: Programming Language :: Python :: 3.10
14
14
  Classifier: Programming Language :: Python :: 3.11
15
- Requires-Dist: airbyte-cdk (==0.80.0)
15
+ Requires-Dist: airbyte-cdk (==0.90.0)
16
16
  Requires-Dist: sgqlc (==16.3)
17
17
  Project-URL: Documentation, https://docs.airbyte.com/integrations/sources/github
18
18
  Project-URL: Repository, https://github.com/airbytehq/airbyte
@@ -5,7 +5,7 @@ requires = [
5
5
  build-backend = "poetry.core.masonry.api"
6
6
 
7
7
  [tool.poetry]
8
- version = "1.7.6"
8
+ version = "1.7.8"
9
9
  name = "airbyte-source-github"
10
10
  description = "Source implementation for GitHub."
11
11
  authors = [
@@ -22,7 +22,7 @@ packages = [
22
22
 
23
23
  [tool.poetry.dependencies]
24
24
  python = "^3.9,<3.12"
25
- airbyte-cdk = "0.80.0"
25
+ airbyte-cdk = "0.90.0"
26
26
  sgqlc = "==16.3"
27
27
 
28
28
  [tool.poetry.scripts]
@@ -13,6 +13,7 @@ import requests
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.core import CheckpointMixin
16
17
  from airbyte_cdk.sources.streams.http import HttpStream
17
18
  from airbyte_cdk.sources.streams.http.exceptions import DefaultBackoffException
18
19
  from airbyte_cdk.utils import AirbyteTracedException
@@ -47,6 +48,7 @@ class GithubStreamABC(HttpStream, ABC):
47
48
 
48
49
  self.access_token_type = access_token_type
49
50
  self.api_url = api_url
51
+ self.state = {}
50
52
 
51
53
  @property
52
54
  def url_base(self) -> str:
@@ -255,7 +257,7 @@ class GithubStream(GithubStreamABC):
255
257
  return record
256
258
 
257
259
 
258
- class SemiIncrementalMixin:
260
+ class SemiIncrementalMixin(CheckpointMixin):
259
261
  """
260
262
  Semi incremental streams are also incremental but with one difference, they:
261
263
  - read all records;
@@ -279,6 +281,14 @@ class SemiIncrementalMixin:
279
281
  self._start_date = start_date
280
282
  self._starting_point_cache = {}
281
283
 
284
+ @property
285
+ def state(self) -> MutableMapping[str, Any]:
286
+ return self._state
287
+
288
+ @state.setter
289
+ def state(self, value: MutableMapping[str, Any]):
290
+ self._state = value
291
+
282
292
  @property
283
293
  def slice_keys(self):
284
294
  if hasattr(self, "repositories"):
@@ -295,7 +305,7 @@ class SemiIncrementalMixin:
295
305
  if self.is_sorted == "asc":
296
306
  return self.page_size
297
307
 
298
- def get_updated_state(self, current_stream_state: MutableMapping[str, Any], latest_record: Mapping[str, Any]):
308
+ def _get_updated_state(self, current_stream_state: MutableMapping[str, Any], latest_record: Mapping[str, Any]):
299
309
  """
300
310
  Return the latest state by comparing the cursor value in the latest record with the stream's most recent state
301
311
  object and returning an updated state object.
@@ -338,6 +348,7 @@ class SemiIncrementalMixin:
338
348
  cursor_value = self.convert_cursor_value(record[self.cursor_field])
339
349
  if not start_point or cursor_value > start_point:
340
350
  yield record
351
+ self.state = self._get_updated_state(self.state, record)
341
352
  elif self.is_sorted == "desc" and cursor_value < start_point:
342
353
  break
343
354
 
@@ -719,7 +730,7 @@ class Commits(IncrementalMixin, GithubStream):
719
730
 
720
731
  return record
721
732
 
722
- def get_updated_state(self, current_stream_state: MutableMapping[str, Any], latest_record: Mapping[str, Any]):
733
+ def _get_updated_state(self, current_stream_state: MutableMapping[str, Any], latest_record: Mapping[str, Any]):
723
734
  repository = latest_record["repository"]
724
735
  branch = latest_record["branch"]
725
736
  updated_state = latest_record[self.cursor_field]
@@ -1004,7 +1015,7 @@ class ProjectsV2(SemiIncrementalMixin, GitHubGraphQLStream):
1004
1015
  # Reactions streams
1005
1016
 
1006
1017
 
1007
- class ReactionStream(GithubStream, ABC):
1018
+ class ReactionStream(GithubStream, CheckpointMixin, ABC):
1008
1019
 
1009
1020
  parent_key = "id"
1010
1021
  copy_parent_key = "comment_id"
@@ -1023,6 +1034,14 @@ class ReactionStream(GithubStream, ABC):
1023
1034
  Specify the class of the parent stream for which receive reactions
1024
1035
  """
1025
1036
 
1037
+ @property
1038
+ def state(self) -> MutableMapping[str, Any]:
1039
+ return self._state
1040
+
1041
+ @state.setter
1042
+ def state(self, value: MutableMapping[str, Any]):
1043
+ self._state = value
1044
+
1026
1045
  def path(self, stream_slice: Mapping[str, Any] = None, **kwargs) -> str:
1027
1046
  parent_path = self._parent_stream.path(stream_slice=stream_slice, **kwargs)
1028
1047
  return f"{parent_path}/{stream_slice[self.copy_parent_key]}/reactions"
@@ -1032,7 +1051,7 @@ class ReactionStream(GithubStream, ABC):
1032
1051
  for parent_record in self._parent_stream.read_records(sync_mode=SyncMode.full_refresh, stream_slice=stream_slice):
1033
1052
  yield {self.copy_parent_key: parent_record[self.parent_key], "repository": stream_slice["repository"]}
1034
1053
 
1035
- def get_updated_state(self, current_stream_state: MutableMapping[str, Any], latest_record: Mapping[str, Any]):
1054
+ def _get_updated_state(self, current_stream_state: MutableMapping[str, Any], latest_record: Mapping[str, Any]):
1036
1055
  repository = latest_record["repository"]
1037
1056
  parent_id = str(latest_record[self.copy_parent_key])
1038
1057
  updated_state = latest_record[self.cursor_field]
@@ -1066,6 +1085,7 @@ class ReactionStream(GithubStream, ABC):
1066
1085
  ):
1067
1086
  if not starting_point or record[self.cursor_field] > starting_point:
1068
1087
  yield record
1088
+ self.state = self._get_updated_state(self.state, record)
1069
1089
 
1070
1090
  def transform(self, record: MutableMapping[str, Any], stream_slice: Mapping[str, Any]) -> MutableMapping[str, Any]:
1071
1091
  record = super().transform(record, stream_slice)
@@ -1321,6 +1341,7 @@ class ProjectColumns(GithubStream):
1321
1341
  ):
1322
1342
  if not starting_point or record[self.cursor_field] > starting_point:
1323
1343
  yield record
1344
+ self.state = self._get_updated_state(self.state, record)
1324
1345
 
1325
1346
  def get_starting_point(self, stream_state: Mapping[str, Any], stream_slice: Mapping[str, Any]) -> str:
1326
1347
  if stream_state:
@@ -1333,7 +1354,7 @@ class ProjectColumns(GithubStream):
1333
1354
  return stream_state_value
1334
1355
  return self._start_date
1335
1356
 
1336
- def get_updated_state(self, current_stream_state: MutableMapping[str, Any], latest_record: Mapping[str, Any]):
1357
+ def _get_updated_state(self, current_stream_state: MutableMapping[str, Any], latest_record: Mapping[str, Any]):
1337
1358
  repository = latest_record["repository"]
1338
1359
  project_id = str(latest_record["project_id"])
1339
1360
  updated_state = latest_record[self.cursor_field]
@@ -1391,6 +1412,7 @@ class ProjectCards(GithubStream):
1391
1412
  ):
1392
1413
  if not starting_point or record[self.cursor_field] > starting_point:
1393
1414
  yield record
1415
+ self.state = self._get_updated_state(self.state, record)
1394
1416
 
1395
1417
  def get_starting_point(self, stream_state: Mapping[str, Any], stream_slice: Mapping[str, Any]) -> str:
1396
1418
  if stream_state:
@@ -1404,7 +1426,7 @@ class ProjectCards(GithubStream):
1404
1426
  return stream_state_value
1405
1427
  return self._start_date
1406
1428
 
1407
- def get_updated_state(self, current_stream_state: MutableMapping[str, Any], latest_record: Mapping[str, Any]):
1429
+ def _get_updated_state(self, current_stream_state: MutableMapping[str, Any], latest_record: Mapping[str, Any]):
1408
1430
  repository = latest_record["repository"]
1409
1431
  project_id = str(latest_record["project_id"])
1410
1432
  column_id = str(latest_record["column_id"])