From 4802ee4ed55b0a7ca8b8ab57a0be5488071ccbdb Mon Sep 17 00:00:00 2001 From: Dinis Louseiro Date: Mon, 15 Jan 2024 20:10:59 +0100 Subject: [PATCH 1/3] Add files schema to schema_objects --- tap_github/schema_objects.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tap_github/schema_objects.py b/tap_github/schema_objects.py index 7a74ed2c..b11a070c 100644 --- a/tap_github/schema_objects.py +++ b/tap_github/schema_objects.py @@ -59,3 +59,17 @@ th.Property("rocket", th.IntegerType), th.Property("eyes", th.IntegerType), ) + +files_object = th.ObjectType( + th.Property("sha", th.StringType), + th.Property("filename", th.StringType), + th.Property("status", th.StringType), + th.Property("additions", th.IntegerType), + th.Property("deletions", th.IntegerType), + th.Property("changes", th.IntegerType), + th.Property("blob_url", th.StringType), + th.Property("raw_url", th.StringType), + th.Property("contents_url", th.StringType), + th.Property("patch", th.StringType), + th.Property("previous_filename", th.StringType) +) From e2293e0a499a2592ef5f57618883d12770dc9d60 Mon Sep 17 00:00:00 2001 From: Dinis Louseiro Date: Mon, 15 Jan 2024 20:11:19 +0100 Subject: [PATCH 2/3] Add files to `CommitsStream` --- tap_github/repository_streams.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tap_github/repository_streams.py b/tap_github/repository_streams.py index d70889b6..56d11db6 100644 --- a/tap_github/repository_streams.py +++ b/tap_github/repository_streams.py @@ -11,6 +11,7 @@ from tap_github.client import GitHubGraphqlStream, GitHubRestStream from tap_github.schema_objects import ( + files_object, label_object, milestone_object, reactions_object, @@ -1105,6 +1106,7 @@ def post_process(self, row: dict, context: Optional[Dict] = None) -> dict: ), th.Property("author", user_object), th.Property("committer", user_object), + th.Property("files", th.ArrayType(files_object)), ).to_dict() From a1d412e1cacc1e805f87f18dd02a69edfcfa7aa5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 15 Jan 2024 19:22:18 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tap_github/schema_objects.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tap_github/schema_objects.py b/tap_github/schema_objects.py index b11a070c..98381f16 100644 --- a/tap_github/schema_objects.py +++ b/tap_github/schema_objects.py @@ -71,5 +71,5 @@ th.Property("raw_url", th.StringType), th.Property("contents_url", th.StringType), th.Property("patch", th.StringType), - th.Property("previous_filename", th.StringType) + th.Property("previous_filename", th.StringType), )