From 7e5c616453d775a34ce70ede602c35fd15f1883c Mon Sep 17 00:00:00 2001 From: Daryna Ishchenko <80129833+darynaishchenko@users.noreply.github.com> Date: Thu, 9 Oct 2025 16:29:34 +0300 Subject: [PATCH] fix(source-github): fix min time to wait on token rate limits (#67589) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What there is an issue while processing min time to wait on token rate limits: .seconds - returns positive value fixed to .total_seconds() - returns both negative and positive values. (negative when reset time for token is older then datetime now) ## How ## Review guide ## User Impact ## Can this PR be safely reverted and rolled back? - [ ] YES 💚 - [ ] NO ❌ --- airbyte-integrations/connectors/source-github/metadata.yaml | 2 +- airbyte-integrations/connectors/source-github/pyproject.toml | 2 +- .../connectors/source-github/source_github/utils.py | 2 +- docs/integrations/sources/github.md | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/airbyte-integrations/connectors/source-github/metadata.yaml b/airbyte-integrations/connectors/source-github/metadata.yaml index 791475358e9..eceeba7e203 100644 --- a/airbyte-integrations/connectors/source-github/metadata.yaml +++ b/airbyte-integrations/connectors/source-github/metadata.yaml @@ -10,7 +10,7 @@ data: connectorSubtype: api connectorType: source definitionId: ef69ef6e-aa7f-4af1-a01d-ef775033524e - dockerImageTag: 1.9.0-rc.2 + dockerImageTag: 1.9.0-rc.3 dockerRepository: airbyte/source-github documentationUrl: https://docs.airbyte.com/integrations/sources/github erdUrl: https://dbdocs.io/airbyteio/source-github?view=relationships diff --git a/airbyte-integrations/connectors/source-github/pyproject.toml b/airbyte-integrations/connectors/source-github/pyproject.toml index 667a9872195..1b7e24083bc 100644 --- a/airbyte-integrations/connectors/source-github/pyproject.toml +++ b/airbyte-integrations/connectors/source-github/pyproject.toml @@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",] build-backend = "poetry.core.masonry.api" [tool.poetry] -version = "1.9.0-rc.2" +version = "1.9.0-rc.3" name = "source-github" description = "Source implementation for GitHub." authors = [ "Airbyte ",] diff --git a/airbyte-integrations/connectors/source-github/source_github/utils.py b/airbyte-integrations/connectors/source-github/source_github/utils.py index 302090f7e49..f3d916c5774 100644 --- a/airbyte-integrations/connectors/source-github/source_github/utils.py +++ b/airbyte-integrations/connectors/source-github/source_github/utils.py @@ -144,7 +144,7 @@ class MultipleTokenAuthenticatorWithRateLimiter(AbstractHeaderAuthenticator): setattr(current_token, count_attr, getattr(current_token, count_attr) - 1) return True elif all(getattr(x, count_attr) == 0 for x in self._tokens.values()): - min_time_to_wait = min((getattr(x, reset_attr) - ab_datetime_now()).seconds for x in self._tokens.values()) + min_time_to_wait = min((getattr(x, reset_attr) - ab_datetime_now()).total_seconds() for x in self._tokens.values()) if min_time_to_wait < self.max_time: time.sleep(min_time_to_wait if min_time_to_wait > 0 else 0) self.check_all_tokens() diff --git a/docs/integrations/sources/github.md b/docs/integrations/sources/github.md index 60825cc6933..45d10179423 100644 --- a/docs/integrations/sources/github.md +++ b/docs/integrations/sources/github.md @@ -225,6 +225,7 @@ Your token should have at least the `repo` scope. Depending on which streams you | Version | Date | Pull Request | Subject | |:-----------|:-----------|:------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| 1.9.0-rc.3 | 2025-10-09 | [67589](https://github.com/airbytehq/airbyte/pull/67589) | Fix min time to wait on token rate limits | | 1.9.0-rc.2 | 2025-10-03 | [67026](https://github.com/airbytehq/airbyte/pull/67026) | Fix converting datetime in workflows stream | | 1.9.0-rc.1 | 2025-10-02 | [66736](https://github.com/airbytehq/airbyte/pull/66736) | Update to airbyte-cdk v^7 | | 1.8.42 | 2025-09-30 | [66166](https://github.com/airbytehq/airbyte/pull/66166) | Update dependencies |