airbyte-source-google-drive 0.4.0.dev202504091818__py3-none-any.whl → 0.4.0.dev202504161719__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.
Potentially problematic release.
This version of airbyte-source-google-drive might be problematic. Click here for more details.
- {airbyte_source_google_drive-0.4.0.dev202504091818.dist-info → airbyte_source_google_drive-0.4.0.dev202504161719.dist-info}/METADATA +2 -2
- {airbyte_source_google_drive-0.4.0.dev202504091818.dist-info → airbyte_source_google_drive-0.4.0.dev202504161719.dist-info}/RECORD +5 -5
- source_google_drive/stream_reader.py +15 -2
- {airbyte_source_google_drive-0.4.0.dev202504091818.dist-info → airbyte_source_google_drive-0.4.0.dev202504161719.dist-info}/WHEEL +0 -0
- {airbyte_source_google_drive-0.4.0.dev202504091818.dist-info → airbyte_source_google_drive-0.4.0.dev202504161719.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.4.0.
|
|
3
|
+
Version: 0.4.0.dev202504161719
|
|
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.45.
|
|
13
|
+
Requires-Dist: airbyte-cdk[file-based] (==6.45.4.post49.dev14495925594)
|
|
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)
|
|
@@ -6,9 +6,9 @@ source_google_drive/schemas/identities.json,sha256=JXBR_v0wpfDKiWVzLoc8bPs33x5CG
|
|
|
6
6
|
source_google_drive/source.py,sha256=Hmz60uMCQZyA9AhCN0bOUSW2iL3GW6VTwI5vrK0D1RY,4140
|
|
7
7
|
source_google_drive/spec.py,sha256=-WkA2zGuQtf3G7uK8uq9BnimUlQh0s3vsqROmIHOgzI,4718
|
|
8
8
|
source_google_drive/stream_permissions_reader.py,sha256=88bSJBC5n2svioTDwgVqf0x5yXRxityk_i0xokWEJcQ,9026
|
|
9
|
-
source_google_drive/stream_reader.py,sha256=
|
|
9
|
+
source_google_drive/stream_reader.py,sha256=L9NwJWsPspY0_2w3ipRcYU6dH_xqCysc_mMylX09b4E,15531
|
|
10
10
|
source_google_drive/utils.py,sha256=ewR-kBKLmtD-s7zqCfGECfzWYF43tpQdscAQIlUEkR8,1022
|
|
11
|
-
airbyte_source_google_drive-0.4.0.
|
|
12
|
-
airbyte_source_google_drive-0.4.0.
|
|
13
|
-
airbyte_source_google_drive-0.4.0.
|
|
14
|
-
airbyte_source_google_drive-0.4.0.
|
|
11
|
+
airbyte_source_google_drive-0.4.0.dev202504161719.dist-info/METADATA,sha256=3dZkqQBqApBxzvVb8BhMfh8uWTT-aB-iqveVw4i-_d8,5549
|
|
12
|
+
airbyte_source_google_drive-0.4.0.dev202504161719.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
|
|
13
|
+
airbyte_source_google_drive-0.4.0.dev202504161719.dist-info/entry_points.txt,sha256=YgpJf0nA5Mn0B7YC9VOFI847vz1jI6U4q7BeLUOXa54,67
|
|
14
|
+
airbyte_source_google_drive-0.4.0.dev202504161719.dist-info/RECORD,,
|
|
@@ -63,6 +63,15 @@ class GoogleDriveRemoteFile(RemoteFile):
|
|
|
63
63
|
# The mime type of the file as returned by the Google Drive API
|
|
64
64
|
# This is not the same as the mime type when opened by the parser (e.g. google docs is exported as docx)
|
|
65
65
|
original_mime_type: str
|
|
66
|
+
view_link: str
|
|
67
|
+
# Only populated for items in shared drives.
|
|
68
|
+
drive_id: Optional[str] = None
|
|
69
|
+
|
|
70
|
+
@property
|
|
71
|
+
def url(self) -> str:
|
|
72
|
+
if self.drive_id:
|
|
73
|
+
return f"https://drive.google.com/open?id={self.id}&driveId={self.drive_id}"
|
|
74
|
+
return self.view_link
|
|
66
75
|
|
|
67
76
|
|
|
68
77
|
class SourceGoogleDriveStreamReader(AbstractFileBasedStreamReader):
|
|
@@ -134,10 +143,11 @@ class SourceGoogleDriveStreamReader(AbstractFileBasedStreamReader):
|
|
|
134
143
|
(path, folder_id) = folder_id_queue.pop()
|
|
135
144
|
# fetch all files in this folder (1000 is the max page size)
|
|
136
145
|
# supportsAllDrives and includeItemsFromAllDrives are required to access files in shared drives
|
|
146
|
+
# ref https://developers.google.com/workspace/drive/api/reference/rest/v3/files#File
|
|
137
147
|
request = service.files().list(
|
|
138
148
|
q=f"'{folder_id}' in parents",
|
|
139
149
|
pageSize=1000,
|
|
140
|
-
fields="nextPageToken, files(id, name, modifiedTime, mimeType)",
|
|
150
|
+
fields="nextPageToken, files(id, name, modifiedTime, mimeType, webViewLink, driveId)",
|
|
141
151
|
supportsAllDrives=True,
|
|
142
152
|
includeItemsFromAllDrives=True,
|
|
143
153
|
)
|
|
@@ -172,6 +182,8 @@ class SourceGoogleDriveStreamReader(AbstractFileBasedStreamReader):
|
|
|
172
182
|
id=new_file["id"],
|
|
173
183
|
original_mime_type=original_mime_type,
|
|
174
184
|
mime_type=mime_type,
|
|
185
|
+
drive_id=new_file.get("driveId"),
|
|
186
|
+
view_link=new_file.get("webViewLink"),
|
|
175
187
|
)
|
|
176
188
|
if self.file_matches_globs(remote_file, globs):
|
|
177
189
|
yield remote_file
|
|
@@ -266,7 +278,7 @@ class SourceGoogleDriveStreamReader(AbstractFileBasedStreamReader):
|
|
|
266
278
|
raise FileSizeLimitError(message=message, internal_message=message, failure_type=FailureType.config_error)
|
|
267
279
|
|
|
268
280
|
try:
|
|
269
|
-
file_paths = self._get_file_transfer_paths(file, local_directory)
|
|
281
|
+
file_paths = self._get_file_transfer_paths(source_file_relative_path=file.uri, staging_directory=local_directory)
|
|
270
282
|
local_file_path = file_paths[self.LOCAL_FILE_PATH]
|
|
271
283
|
file_relative_path = file_paths[self.FILE_RELATIVE_PATH]
|
|
272
284
|
file_name = file_paths[self.FILE_NAME]
|
|
@@ -300,6 +312,7 @@ class SourceGoogleDriveStreamReader(AbstractFileBasedStreamReader):
|
|
|
300
312
|
id=file.id,
|
|
301
313
|
mime_type=file.mime_type,
|
|
302
314
|
updated_at=file.last_modified.strftime("%Y-%m-%dT%H:%M:%S.%fZ"),
|
|
315
|
+
source_uri=file.url,
|
|
303
316
|
)
|
|
304
317
|
file_reference = AirbyteRecordMessageFileReference(
|
|
305
318
|
staging_file_url=local_file_path,
|
|
File without changes
|