Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reverting transformer change to avoid excess loggin #16

Merged
merged 1 commit into from
Apr 10, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 22 additions & 29 deletions tap_github.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,9 @@ def get_all_pull_requests(schemas, config, state):
pr_num = pr.get('number')

# transform and write pull_request record
with singer.Transformer() as bumble_bee:
rec = bumble_bee.transform(pr, schemas['pull_requests'])
singer.write_record('pull_requests', rec, time_extracted=extraction_time)
counter.increment()
rec = singer.transform(pr, schemas['pull_requests'])
singer.write_record('pull_requests', rec, time_extracted=extraction_time)
counter.increment()

# sync reviews if that schema is present (only there if selected)
if schemas.get('reviews'):
Expand All @@ -152,10 +151,9 @@ def sync_reviews_for_pr(pr_number, schema, config, state):
):
reviews = response.json()
extraction_time = singer.utils.now()
for review in reviews:
with singer.Transformer() as bumble_bee:
rec = bumble_bee.transform(review, schema)
singer.write_record('reviews', reviews, time_extracted=extraction_time)
for review in reviews:
rec = singer.transform(review, schema)
singer.write_record('reviews', reviews, time_extracted=extraction_time)

return state

Expand All @@ -172,10 +170,9 @@ def get_all_assignees(schema, config, state):
assignees = response.json()
extraction_time = singer.utils.now()
for assignee in assignees:
with singer.Transformer() as bumble_bee:
rec = bumble_bee.transform(assignee, schema)
singer.write_record('assignees', rec, time_extracted=extraction_time)
counter.increment()
rec = singer.transform(assignee, schema)
singer.write_record('assignees', rec, time_extracted=extraction_time)
counter.increment()

return state

Expand All @@ -192,10 +189,9 @@ def get_all_collaborators(schema, config, state):
collaborators = response.json()
extraction_time = singer.utils.now()
for collaborator in collaborators:
with singer.Transformer() as bumble_bee:
rec = bumble_bee.transform(collaborator, schema)
singer.write_record('collaborators', rec, time_extracted=extraction_time)
counter.increment()
rec = singer.transform(collaborator, schema)
singer.write_record('collaborators', rec, time_extracted=extraction_time)
counter.increment()

return state

Expand All @@ -219,10 +215,9 @@ def get_all_commits(schema, config, state):
commits = response.json()
extraction_time = singer.utils.now()
for commit in commits:
with singer.Transformer() as bumble_bee:
rec = bumble_bee.transform(commit, schema)
singer.write_record('commits', rec, time_extracted=extraction_time)
counter.increment()
rec = singer.transform(commit, schema)
singer.write_record('commits', rec, time_extracted=extraction_time)
counter.increment()

return state

Expand All @@ -245,10 +240,9 @@ def get_all_issues(schema, config, state):
issues = response.json()
extraction_time = singer.utils.now()
for issue in issues:
with singer.Transformer() as bumble_bee:
rec = bumble_bee.transform(issue, schema)
singer.write_record('issues', rec, time_extracted=extraction_time)
counter.increment()
rec = singer.transform(issue, schema)
singer.write_record('issues', rec, time_extracted=extraction_time)
counter.increment()
return state

def get_all_stargazers(schema, config, state):
Expand All @@ -271,11 +265,10 @@ def get_all_stargazers(schema, config, state):
stargazers = response.json()
extraction_time = singer.utils.now()
for stargazer in stargazers:
with singer.Transformer() as bumble_bee:
rec = bumble_bee.transform(stargazer, schema)
rec['user_id'] = rec['user']['id']
singer.write_record('stargazers', rec, time_extracted=extraction_time)
counter.increment()
rec = singer.transform(stargazer, schema)
rec['user_id'] = rec['user']['id']
singer.write_record('stargazers', rec, time_extracted=extraction_time)
counter.increment()

return state

Expand Down