From a7cc99c13ef31b8594e42bee0a84f8e5b3e472de Mon Sep 17 00:00:00 2001 From: "david.lachasse@gmail.com" Date: Wed, 29 Jun 2022 15:01:59 -0700 Subject: [PATCH] Add user login attribute to stagazers schema --- tap_github/__init__.py | 2 ++ tap_github/schemas/stargazers.json | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tap_github/__init__.py b/tap_github/__init__.py index 5c2d768a..fe7516c2 100644 --- a/tap_github/__init__.py +++ b/tap_github/__init__.py @@ -1043,10 +1043,12 @@ def get_all_stargazers(schema, repo_path, state, mdata, _start_date): extraction_time = singer.utils.now() for stargazer in stargazers: user_id = stargazer['user']['id'] + login = stargazer['user']['login'] stargazer['_sdc_repository'] = repo_path with singer.Transformer() as transformer: rec = transformer.transform(stargazer, schema, metadata=metadata.to_map(mdata)) rec['user_id'] = user_id + rec['login'] = login singer.write_record('stargazers', rec, time_extracted=extraction_time) counter.increment() diff --git a/tap_github/schemas/stargazers.json b/tap_github/schemas/stargazers.json index d8d67b30..467dc5b8 100644 --- a/tap_github/schemas/stargazers.json +++ b/tap_github/schemas/stargazers.json @@ -20,6 +20,9 @@ }, "user_id": { "type": ["null", "integer"] + }, + "login": { + "type": ["null", "string"] } } -} +} \ No newline at end of file