diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0546aac2..89480884 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ ci: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: check-json exclude: "\\.vscode/.*.json" @@ -15,13 +15,13 @@ repos: - id: trailing-whitespace - repo: https://github.com/asottile/pyupgrade - rev: v3.15.1 + rev: v3.16.0 hooks: - id: pyupgrade args: [--py37-plus] - repo: https://github.com/psf/black - rev: 24.2.0 + rev: 24.4.2 hooks: - id: black @@ -31,7 +31,7 @@ repos: - id: isort - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.8.0 + rev: v1.11.0 hooks: - id: mypy pass_filenames: true 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())