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

Handle issue events not linked to any issue #28

Closed
ericboucher opened this issue Sep 27, 2021 · 1 comment · Fixed by #147
Closed

Handle issue events not linked to any issue #28

ericboucher opened this issue Sep 27, 2021 · 1 comment · Fixed by #147
Labels
bug Something isn't working good first issue Good for newcomers skills:Python

Comments

@ericboucher
Copy link
Contributor

I am unsure of what situation it reflects, but I have been seeing the following error on issue_events where there doesn't seem to be any linked issue and we get an AttributeError: 'NoneType' object has no attribute 'pop'.

To start, we could simply add a check for the issue object and set null issue_number and issue_url if the object does not exist. Thoughts?

time=2021-09-27 15:42:20 name=tap-github level=INFO message=INFO METRIC: {'type': 'timer', 'metric': 'http_request_duration', 'value': 1.158103, 'tags': {'endpoint': '/repos/{org}/{repo}/issues/events', 'http_status_code': 200, 'status': 'succeeded', 'context': {'org': 'facebook', 'repo': 'react'}}}
Traceback (most recent call last):
.../...
tract/.venv/lib/python3.9/site-packages/tap_github/streams.py", line 529, in post_process
    row["issue_number"] = int(row["issue"].pop("number"))
AttributeError: 'NoneType' object has no attribute 'pop'
@ericboucher
Copy link
Contributor Author

Issue events can take multiple shapes. In particular, if they only refer to a PR and not an issue, the issue field might not exist.

We should augment the proposed schema and aim towards something a bit more complete, as was done in https://github.com/singer-io/tap-github/blob/master/tap_github/schemas/issue_events.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers skills:Python
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant