Skip to content

Commit

Permalink
Source Google Search Console: Update deprecated auth (#38649)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristoGrab authored May 28, 2024
1 parent f3c6ca4 commit 3f4ce26
Show file tree
Hide file tree
Showing 6 changed files with 420 additions and 109 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ data:
connectorSubtype: api
connectorType: source
definitionId: eb4c9e00-db83-4d63-a386-39cfa91012a8
dockerImageTag: 1.4.2
dockerImageTag: 1.4.3
dockerRepository: airbyte/source-google-search-console
documentationUrl: https://docs.airbyte.com/integrations/sources/google-search-console
githubIssueLabel: source-google-search-console
Expand Down
514 changes: 412 additions & 102 deletions airbyte-integrations/connectors/source-google-search-console/poetry.lock

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
version = "1.4.2"
version = "1.4.3"
name = "source-google-search-console"
description = "Source implementation for Google Search Console."
authors = [ "Airbyte <[email protected]>",]
Expand All @@ -18,7 +18,7 @@ include = "source_google_search_console"
[tool.poetry.dependencies]
python = "^3.9,<3.12"
google-api-python-client = "==2.105.0"
airbyte-cdk = "0.80.0"
airbyte-cdk = "0.90.0"
google-auth = "==2.23.3"

[tool.poetry.scripts]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from airbyte_cdk.models import FailureType, SyncMode
from airbyte_cdk.sources import AbstractSource
from airbyte_cdk.sources.streams import Stream
from airbyte_cdk.sources.streams.http.auth import Oauth2Authenticator
from airbyte_cdk.sources.streams.http.requests_native_auth import Oauth2Authenticator
from airbyte_cdk.utils import AirbyteTracedException
from source_google_search_console.exceptions import (
InvalidSiteURLValidationError,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import requests
from airbyte_cdk.models import SyncMode
from airbyte_cdk.sources.streams.http import HttpStream
from airbyte_cdk.sources.streams.http.auth import HttpAuthenticator
from requests.auth import AuthBase

BASE_URL = "https://www.googleapis.com/webmasters/v3/"
ROW_LIMIT = 25000
Expand All @@ -30,7 +30,7 @@ class GoogleSearchConsole(HttpStream, ABC):

def __init__(
self,
authenticator: Union[HttpAuthenticator, requests.auth.AuthBase],
authenticator: AuthBase,
site_urls: list,
start_date: str,
end_date: str,
Expand Down Expand Up @@ -366,7 +366,7 @@ def request_body_json(
) -> Optional[Union[Dict[str, Any], str]]:
data = super().request_body_json(stream_state, stream_slice, next_page_token)

stream = SearchAppearance(self.authenticator, self._site_urls, self._start_date, self._end_date)
stream = SearchAppearance(self._session.auth, self._site_urls, self._start_date, self._end_date)
keywords_records = stream.read_records(sync_mode=SyncMode.full_refresh, stream_state=stream_state, stream_slice=stream_slice)
keywords = {record["searchAppearance"] for record in keywords_records}
filters = []
Expand Down
1 change: 1 addition & 0 deletions docs/integrations/sources/google-search-console.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ Google Search Console only retains data for websites from the last 16 months. An

| Version | Date | Pull Request | Subject |
| :------ | :--------- | :------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------- |
| 1.4.3 | 2024-05-24 | [38649](https://github.com/airbytehq/airbyte/pull/38649) | Update deprecated auth package |
| 1.4.2 | 2024-04-19 | [36639](https://github.com/airbytehq/airbyte/pull/36639) | Updating to 0.80.0 CDK |
| 1.4.1 | 2024-04-12 | [36639](https://github.com/airbytehq/airbyte/pull/36639) | Schema descriptions |
| 1.4.0 | 2024-03-19 | [36267](https://github.com/airbytehq/airbyte/pull/36267) | Pin airbyte-cdk version to `^0` |
Expand Down

0 comments on commit 3f4ce26

Please sign in to comment.