Handle anonymous contributors#1357
Open
CodingFeng101 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Contributornow handles anonymous contributor records returned by the contributors API whenanon=true. Anonymous records keep theirname,email, and contribution count without trying to parse missing user URL/avatar fields.Why
This addresses #891. GitHub can return anonymous contributor records that do not include the full user payload. The previous parsing path always used
_User._update_attributes(), so it raisedIncompleteResponsefrom a missing field such asavatar_urlbefore iteration could continue.Validation
python -m pytest tests\unit\test_users.py::TestContributor -qpython -m pytest tests\unit\test_repos_repo.py::TestRepositoryIterator::test_contributors tests\unit\test_repos_repo.py::TestRepositoryIterator::test_contributors_with_anon -qpython -m compileall -q src\github3\users.py tests\unit\test_users.pypython -m black --check src\github3\users.py tests\unit\test_users.pypython -m flake8 src\github3\users.py tests\unit\test_users.pygit diff --check