airbyte-source-google-drive 0.2.0.dev202501272232__py3-none-any.whl → 0.2.0.dev202501291717__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {airbyte_source_google_drive-0.2.0.dev202501272232.dist-info → airbyte_source_google_drive-0.2.0.dev202501291717.dist-info}/METADATA +2 -2
- airbyte_source_google_drive-0.2.0.dev202501291717.dist-info/RECORD +11 -0
- source_google_drive/spec.py +2 -12
- source_google_drive/stream_reader.py +2 -8
- airbyte_source_google_drive-0.2.0.dev202501272232.dist-info/RECORD +0 -12
- source_google_drive/temp_mock.py +0 -36
- {airbyte_source_google_drive-0.2.0.dev202501272232.dist-info → airbyte_source_google_drive-0.2.0.dev202501291717.dist-info}/WHEEL +0 -0
- {airbyte_source_google_drive-0.2.0.dev202501272232.dist-info → airbyte_source_google_drive-0.2.0.dev202501291717.dist-info}/entry_points.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: airbyte-source-google-drive
|
|
3
|
-
Version: 0.2.0.
|
|
3
|
+
Version: 0.2.0.dev202501291717
|
|
4
4
|
Summary: Source implementation for Google Drive.
|
|
5
5
|
License: ELv2
|
|
6
6
|
Author: Airbyte
|
|
@@ -10,7 +10,7 @@ Classifier: License :: Other/Proprietary License
|
|
|
10
10
|
Classifier: Programming Language :: Python :: 3
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.10
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
-
Requires-Dist: airbyte-cdk[file-based] (==6.26.0.
|
|
13
|
+
Requires-Dist: airbyte-cdk[file-based] (==6.26.0.dev04106)
|
|
14
14
|
Requires-Dist: google-api-python-client (==2.104.0)
|
|
15
15
|
Requires-Dist: google-api-python-client-stubs (==1.18.0)
|
|
16
16
|
Requires-Dist: google-auth-httplib2 (==0.1.1)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
source_google_drive/__init__.py,sha256=SAgPIoGpjdHTY7mvf__A99FiElBh3WvdKSHLstg-BUE,134
|
|
2
|
+
source_google_drive/exceptions.py,sha256=6sBxbdZhj0CARkctfBaNgGHB_GGcFUkY4cnMUWyOruM,268
|
|
3
|
+
source_google_drive/run.py,sha256=5AQd906FbSGaNZj0udrr-VKmiSS4nsor7F7noMjsdi0,677
|
|
4
|
+
source_google_drive/source.py,sha256=OyKTjPg80KR8yZiYiC3YSi6E6egothtAn3YAHAS6Q6A,2839
|
|
5
|
+
source_google_drive/spec.py,sha256=YPOmOInQfmwHeB6Ay2z78LNvHsggncwU1bchQOsAZSk,4268
|
|
6
|
+
source_google_drive/stream_reader.py,sha256=DClCknbFqAq1SZQQBJnWVpbIoJkfu7ZeLzLh0E0aE5U,20292
|
|
7
|
+
source_google_drive/utils.py,sha256=1Fe3J4KXI1iIf4rklgLoR4p1xkCzLQI7zj5dkyi4Vt0,942
|
|
8
|
+
airbyte_source_google_drive-0.2.0.dev202501291717.dist-info/METADATA,sha256=gXbq2ilBqoJCjwtdwqmSgFVL3RxFMlxgwUxODMZT4Yg,5536
|
|
9
|
+
airbyte_source_google_drive-0.2.0.dev202501291717.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
|
10
|
+
airbyte_source_google_drive-0.2.0.dev202501291717.dist-info/entry_points.txt,sha256=YgpJf0nA5Mn0B7YC9VOFI847vz1jI6U4q7BeLUOXa54,67
|
|
11
|
+
airbyte_source_google_drive-0.2.0.dev202501291717.dist-info/RECORD,,
|
source_google_drive/spec.py
CHANGED
|
@@ -17,26 +17,16 @@ from airbyte_cdk.sources.file_based.config.abstract_file_based_spec import (
|
|
|
17
17
|
)
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
class EnableFeatureYes(BaseModel):
|
|
21
|
-
enable_feature: Literal[True] = Field(True, description="Enable this feature.", title="Enable Feature")
|
|
22
|
-
advanced_setting: Optional[str] = Field(None, title="Advanced Setting", description="Additional advanced setting.")
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
class EnableFeatureNo(BaseModel):
|
|
26
|
-
enable_feature: Literal[False] = Field(False, description="Disable this feature.", title="Enable Feature")
|
|
27
|
-
|
|
28
|
-
|
|
29
20
|
class DeliverRecords(DeliverRecordsBase):
|
|
30
21
|
# Overriding to make visible with airbyte_hidden=False
|
|
31
|
-
feature_config: Union[EnableFeatureYes, EnableFeatureNo]
|
|
32
|
-
|
|
33
22
|
sync_acl_permissions: bool = Field(
|
|
34
23
|
title="Include ACL Permissions",
|
|
35
24
|
description="Joins Document allowlists to each stream.",
|
|
36
25
|
default=False,
|
|
37
26
|
airbyte_hidden=False,
|
|
27
|
+
order=0,
|
|
38
28
|
)
|
|
39
|
-
domain: Optional[str] = Field(title="Domain", description="The domain of the identities.", airbyte_hidden=False)
|
|
29
|
+
domain: Optional[str] = Field(title="Domain", description="The domain of the identities.", airbyte_hidden=False, order=1)
|
|
40
30
|
|
|
41
31
|
|
|
42
32
|
class OAuthCredentials(BaseModel):
|
|
@@ -27,9 +27,6 @@ from source_google_drive.utils import get_folder_id
|
|
|
27
27
|
from .exceptions import ErrorDownloadingFile, ErrorFetchingMetadata
|
|
28
28
|
from .spec import SourceGoogleDriveSpec
|
|
29
29
|
|
|
30
|
-
# remove this, just using while test credentials are prepared
|
|
31
|
-
from .temp_mock import _get_looping_google_api_list_response
|
|
32
|
-
|
|
33
30
|
|
|
34
31
|
FOLDER_MIME_TYPE = "application/vnd.google-apps.folder"
|
|
35
32
|
GOOGLE_DOC_MIME_TYPE = "application/vnd.google-apps.document"
|
|
@@ -163,9 +160,8 @@ class SourceGoogleDriveStreamReader(AbstractFileBasedStreamReader):
|
|
|
163
160
|
for item in items:
|
|
164
161
|
yield item
|
|
165
162
|
except Exception as e:
|
|
166
|
-
logger.
|
|
167
|
-
|
|
168
|
-
yield from _get_looping_google_api_list_response(service, key, args)
|
|
163
|
+
logger.error(f"There was an error listing {key} with {args}: {str(e)}")
|
|
164
|
+
raise e
|
|
169
165
|
|
|
170
166
|
def load_identity_groups(self, logger: logging.Logger) -> Dict[str, Any]:
|
|
171
167
|
domain = self.config.delivery_method.domain
|
|
@@ -208,8 +204,6 @@ class SourceGoogleDriveStreamReader(AbstractFileBasedStreamReader):
|
|
|
208
204
|
|
|
209
205
|
yield rfp.dict()
|
|
210
206
|
|
|
211
|
-
return ""
|
|
212
|
-
|
|
213
207
|
def get_matching_files(self, globs: List[str], prefix: Optional[str], logger: logging.Logger) -> Iterable[RemoteFile]:
|
|
214
208
|
"""
|
|
215
209
|
Get all files matching the specified glob patterns.
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
source_google_drive/__init__.py,sha256=SAgPIoGpjdHTY7mvf__A99FiElBh3WvdKSHLstg-BUE,134
|
|
2
|
-
source_google_drive/exceptions.py,sha256=6sBxbdZhj0CARkctfBaNgGHB_GGcFUkY4cnMUWyOruM,268
|
|
3
|
-
source_google_drive/run.py,sha256=5AQd906FbSGaNZj0udrr-VKmiSS4nsor7F7noMjsdi0,677
|
|
4
|
-
source_google_drive/source.py,sha256=OyKTjPg80KR8yZiYiC3YSi6E6egothtAn3YAHAS6Q6A,2839
|
|
5
|
-
source_google_drive/spec.py,sha256=m0pZN1a09DUKZC53M7AbPNcN7klVNQ_TZrDAEhnInDc,4716
|
|
6
|
-
source_google_drive/stream_reader.py,sha256=6dQOzlsMB2XoMIAdJH97Rb_dKVyDQaWeepXAN0GxxzA,20575
|
|
7
|
-
source_google_drive/temp_mock.py,sha256=NdvsAltcZBIqnCBOQuU9R3_yEV5v-bHBR9T_BdjPtU4,1109
|
|
8
|
-
source_google_drive/utils.py,sha256=1Fe3J4KXI1iIf4rklgLoR4p1xkCzLQI7zj5dkyi4Vt0,942
|
|
9
|
-
airbyte_source_google_drive-0.2.0.dev202501272232.dist-info/METADATA,sha256=Yk4Bgn41RG0yg94YHo_oP-TYCVD9dCTPU3j7q5lZL1I,5536
|
|
10
|
-
airbyte_source_google_drive-0.2.0.dev202501272232.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
|
11
|
-
airbyte_source_google_drive-0.2.0.dev202501272232.dist-info/entry_points.txt,sha256=YgpJf0nA5Mn0B7YC9VOFI847vz1jI6U4q7BeLUOXa54,67
|
|
12
|
-
airbyte_source_google_drive-0.2.0.dev202501272232.dist-info/RECORD,,
|
source_google_drive/temp_mock.py
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# Copyright (c) 2024 Airbyte, Inc., all rights reserved.
|
|
2
|
-
|
|
3
|
-
from typing import Any, Iterator
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
def _get_looping_google_api_list_response(service: Any, key: str, args: dict[str, Any]) -> Iterator[dict[str, Any]]:
|
|
7
|
-
domain = args.get("domain") or args.get("groupKey")
|
|
8
|
-
|
|
9
|
-
if key == "users":
|
|
10
|
-
# Mocking 5 users
|
|
11
|
-
for i in range(1, 6):
|
|
12
|
-
yield {
|
|
13
|
-
"primaryEmail": f"user{i}@{domain}",
|
|
14
|
-
"name": {"fullName": f"User {i}"},
|
|
15
|
-
"emails": [{"address": f"user{i}@{domain}"}],
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
elif key == "groups":
|
|
19
|
-
# Mocking 5 groups
|
|
20
|
-
for i in range(1, 6):
|
|
21
|
-
yield {
|
|
22
|
-
"email": f"group{i}@{domain}",
|
|
23
|
-
"name": f"Group {i}",
|
|
24
|
-
"id": f"group-id-{i}",
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
elif key == "members":
|
|
28
|
-
# Mocking 5 members per group
|
|
29
|
-
group_id = args.get("groupKey")
|
|
30
|
-
for i in range(1, 6):
|
|
31
|
-
yield {
|
|
32
|
-
"email": f"member{i}@{domain}",
|
|
33
|
-
"role": "MEMBER",
|
|
34
|
-
"type": "USER",
|
|
35
|
-
"groupId": group_id,
|
|
36
|
-
}
|
|
File without changes
|