Skip to content

Commit c41d793

Browse files
committed
Source Google Drive: update source for compatibility with concurrent CDK
1 parent d746e4d commit c41d793

File tree

5 files changed

+17
-7
lines changed

5 files changed

+17
-7
lines changed

airbyte-integrations/connectors/source-google-drive/metadata.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ data:
77
connectorSubtype: file
88
connectorType: source
99
definitionId: 9f8dda77-1048-4368-815b-269bf54ee9b8
10-
dockerImageTag: 0.0.7
10+
dockerImageTag: 0.0.8
1111
dockerRepository: airbyte/source-google-drive
1212
githubIssueLabel: source-google-drive
1313
icon: google-drive.svg

airbyte-integrations/connectors/source-google-drive/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from setuptools import find_packages, setup
77

88
MAIN_REQUIREMENTS = [
9-
"airbyte-cdk[file-based]==0.59.2", # pinned until compatible with https://github.com/airbytehq/airbyte/pull/34411
9+
"airbyte-cdk[file-based]>=0.60.1",
1010
"google-api-python-client==2.104.0",
1111
"google-auth-httplib2==0.1.1",
1212
"google-auth-oauthlib==1.1.0",

airbyte-integrations/connectors/source-google-drive/source_google_drive/run.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,11 @@
1313
def run():
1414
args = sys.argv[1:]
1515
catalog_path = AirbyteEntrypoint.extract_catalog(args)
16-
source = SourceGoogleDrive(catalog_path)
16+
config_path = AirbyteEntrypoint.extract_config(args)
17+
state_path = AirbyteEntrypoint.extract_state(args)
18+
source = SourceGoogleDrive(
19+
SourceGoogleDrive.read_catalog(catalog_path) if catalog_path else None,
20+
SourceGoogleDrive.read_config(config_path) if config_path else None,
21+
SourceGoogleDrive.read_state(state_path) if state_path else None,
22+
)
1723
launch(source, args)

airbyte-integrations/connectors/source-google-drive/source_google_drive/source.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
#
22
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
33
#
4-
from typing import Any
4+
from typing import Any, Mapping, Optional
55

6-
from airbyte_cdk.models import AdvancedAuth, ConnectorSpecification, OAuthConfigSpecification
6+
from airbyte_cdk.models import AdvancedAuth, ConfiguredAirbyteCatalog, ConnectorSpecification, OAuthConfigSpecification
77
from airbyte_cdk.sources.file_based.file_based_source import FileBasedSource
88
from airbyte_cdk.sources.file_based.stream.cursor.default_file_based_cursor import DefaultFileBasedCursor
9+
from airbyte_cdk.sources.source import TState
910
from source_google_drive.spec import SourceGoogleDriveSpec
1011
from source_google_drive.stream_reader import SourceGoogleDriveStreamReader
1112

1213

1314
class SourceGoogleDrive(FileBasedSource):
14-
def __init__(self, catalog_path: str):
15+
def __init__(self, catalog: Optional[ConfiguredAirbyteCatalog], config: Optional[Mapping[str, Any]], state: Optional[TState]):
1516
super().__init__(
1617
stream_reader=SourceGoogleDriveStreamReader(),
1718
spec_class=SourceGoogleDriveSpec,
18-
catalog_path=catalog_path,
19+
catalog=catalog,
20+
config=config,
21+
state=state,
1922
cursor_cls=DefaultFileBasedCursor,
2023
)
2124

docs/integrations/sources/google-drive.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ Before parsing each document, the connector exports Google Document files to Doc
247247
248248
| Version | Date | Pull Request | Subject |
249249
|---------|------------|-----------------------------------------------------------|--------------------------------------------------------------|
250+
| 0.0.8 | 2024-01-30 | [34681](https://github.com/airbytehq/airbyte/pull/34681) | Unpin CDK version to make compatible with the Concurrent CDK |
250251
| 0.0.7 | 2024-01-30 | [34661](https://github.com/airbytehq/airbyte/pull/34661) | Pin CDK version until upgrade for compatibility with the Concurrent CDK |
251252
| 0.0.6 | 2023-12-16 | [33414](https://github.com/airbytehq/airbyte/pull/33414) | Prepare for airbyte-lib |
252253
| 0.0.5 | 2023-12-14 | [33411](https://github.com/airbytehq/airbyte/pull/33411) | Bump CDK version to auto-set primary key for document file streams and support raw txt files |

0 commit comments

Comments
 (0)