1
0
mirror of synced 2025-12-25 02:09:19 -05:00

bug(source-github): problem getting author for contributor_activity stream (#62054)

This commit is contained in:
Aldo Gonzalez
2025-06-25 16:27:38 -06:00
committed by GitHub
parent 78d81aee11
commit 19243f4d28
5 changed files with 35 additions and 3 deletions

View File

@@ -1488,6 +1488,34 @@ def test_stream_contributor_activity_parse_empty_response(caplog):
assert expected_message in caplog.messages
@responses.activate
def test_stream_contributor_activity_parse_empty_author(caplog):
repository_args = {
"page_size_for_large_streams": 20,
"repositories": ["airbytehq/airbyte"],
}
stream = ContributorActivity(**repository_args)
contributions_without_author = [
{
"author": None,
"total": 0,
"weeks": [{"w": 1713052800, "a": 0, "d": 0, "c": 0}, {"w": 1713657600, "a": 0, "d": 0, "c": 0}],
"repository": "airbytehq/airbyte",
}
]
response_body = json.dumps(contributions_without_author)
responses.add(
responses.GET,
"https://api.github.com/repos/airbytehq/airbyte/stats/contributors",
body=response_body,
status=200,
)
records = list(read_full_refresh(stream))
# expected record should not contain author field as it is None
del contributions_without_author[0]["author"]
assert records == contributions_without_author
@responses.activate
def test_stream_contributor_activity_accepted_response(caplog, rate_limit_mock_response):
responses.add(