Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 15, 2023
1 parent dabb47b commit 4cb2cb5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tap_github/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

EMPTY_REPO_ERROR_STATUS = 409


class GitHubRestStream(RESTStream):
"""GitHub Rest stream class."""

Expand Down Expand Up @@ -188,7 +189,9 @@ def validate_response(self, response: requests.Response) -> None:
https://docs.python-requests.org/en/latest/api/#requests.Response
"""
full_path = urlparse(response.url).path
if response.status_code in (self.tolerated_http_errors + [EMPTY_REPO_ERROR_STATUS]):
if response.status_code in (
self.tolerated_http_errors + [EMPTY_REPO_ERROR_STATUS]
):
msg = (
f"{response.status_code} Tolerated Status Code "
f"(Reason: {response.reason}) for path: {full_path}"
Expand Down Expand Up @@ -243,7 +246,9 @@ def validate_response(self, response: requests.Response) -> None:
def parse_response(self, response: requests.Response) -> Iterable[dict]:
"""Parse the response and return an iterator of result rows."""
# TODO - Split into handle_reponse and parse_response.
if response.status_code in (self.tolerated_http_errors + [EMPTY_REPO_ERROR_STATUS]):
if response.status_code in (
self.tolerated_http_errors + [EMPTY_REPO_ERROR_STATUS]
):
return []

# Update token rate limit info and loop through tokens if needed.
Expand Down

0 comments on commit 4cb2cb5

Please sign in to comment.