From 6b664ac2b58b17aabed365538d08edb6d054d2a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Ram=C3=ADrez-Mondrag=C3=B3n?= Date: Mon, 22 Jul 2024 11:55:10 -0600 Subject: [PATCH] Make mypy happy --- tap_github/client.py | 2 +- tap_github/repository_streams.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tap_github/client.py b/tap_github/client.py index 3cafec1f..7d3ed23a 100644 --- a/tap_github/client.py +++ b/tap_github/client.py @@ -249,7 +249,7 @@ def parse_response(self, response: requests.Response) -> Iterable[dict]: if response.status_code in ( self.tolerated_http_errors + [EMPTY_REPO_ERROR_STATUS] ): - return [] + return # Update token rate limit info and loop through tokens if needed. self.authenticator.update_rate_limit(response.headers) diff --git a/tap_github/repository_streams.py b/tap_github/repository_streams.py index d1c27a37..70ea270a 100644 --- a/tap_github/repository_streams.py +++ b/tap_github/repository_streams.py @@ -356,7 +356,7 @@ def http_headers(self) -> dict: def parse_response(self, response: requests.Response) -> Iterable[dict]: """Parse the README to yield the html response instead of an object.""" if response.status_code in self.tolerated_http_errors: - return [] + return yield {"raw_html": response.text} @@ -726,7 +726,7 @@ class LanguagesStream(GitHubRestStream): def parse_response(self, response: requests.Response) -> Iterable[dict]: """Parse the language response and reformat to return as an iterator of [{language_name: Python, bytes: 23}].""" if response.status_code in self.tolerated_http_errors: - return [] + return languages_json = response.json() for key, value in languages_json.items(): @@ -1537,7 +1537,7 @@ def parse_response(self, response: requests.Response) -> Iterable[dict]: # TODO: update this and validate_response when # https://github.com/meltano/sdk/pull/1754 is merged if response.status_code != 200: - return [] + return yield from super().parse_response(response) def validate_response(self, response: requests.Response) -> None: @@ -2325,7 +2325,7 @@ class TrafficRestStream(GitHubRestStream): def parse_response(self, response: requests.Response) -> Iterable[dict]: if response.status_code != 200: - return [] + return """Parse the response and return an iterator of result rows.""" yield from extract_jsonpath(self.records_jsonpath, input=response.json())