airbyte-source-google-drive 0.4.0.dev202504091818__tar.gz → 0.4.0.dev202504161719__tar.gz

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.

Files changed (13) hide show
  1. {airbyte_source_google_drive-0.4.0.dev202504091818 → airbyte_source_google_drive-0.4.0.dev202504161719}/PKG-INFO +2 -2
  2. {airbyte_source_google_drive-0.4.0.dev202504091818 → airbyte_source_google_drive-0.4.0.dev202504161719}/pyproject.toml +2 -2
  3. {airbyte_source_google_drive-0.4.0.dev202504091818 → airbyte_source_google_drive-0.4.0.dev202504161719}/source_google_drive/stream_reader.py +15 -2
  4. {airbyte_source_google_drive-0.4.0.dev202504091818 → airbyte_source_google_drive-0.4.0.dev202504161719}/README.md +0 -0
  5. {airbyte_source_google_drive-0.4.0.dev202504091818 → airbyte_source_google_drive-0.4.0.dev202504161719}/source_google_drive/__init__.py +0 -0
  6. {airbyte_source_google_drive-0.4.0.dev202504091818 → airbyte_source_google_drive-0.4.0.dev202504161719}/source_google_drive/exceptions.py +0 -0
  7. {airbyte_source_google_drive-0.4.0.dev202504091818 → airbyte_source_google_drive-0.4.0.dev202504161719}/source_google_drive/run.py +0 -0
  8. {airbyte_source_google_drive-0.4.0.dev202504091818 → airbyte_source_google_drive-0.4.0.dev202504161719}/source_google_drive/schemas/file_permissions.json +0 -0
  9. {airbyte_source_google_drive-0.4.0.dev202504091818 → airbyte_source_google_drive-0.4.0.dev202504161719}/source_google_drive/schemas/identities.json +0 -0
  10. {airbyte_source_google_drive-0.4.0.dev202504091818 → airbyte_source_google_drive-0.4.0.dev202504161719}/source_google_drive/source.py +0 -0
  11. {airbyte_source_google_drive-0.4.0.dev202504091818 → airbyte_source_google_drive-0.4.0.dev202504161719}/source_google_drive/spec.py +0 -0
  12. {airbyte_source_google_drive-0.4.0.dev202504091818 → airbyte_source_google_drive-0.4.0.dev202504161719}/source_google_drive/stream_permissions_reader.py +0 -0
  13. {airbyte_source_google_drive-0.4.0.dev202504091818 → airbyte_source_google_drive-0.4.0.dev202504161719}/source_google_drive/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: airbyte-source-google-drive
3
- Version: 0.4.0.dev202504091818
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.0.dev04107)
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)
@@ -5,7 +5,7 @@ requires = [
5
5
  build-backend = "poetry.core.masonry.api"
6
6
 
7
7
  [tool.poetry]
8
- version = "0.4.0.dev202504091818"
8
+ version = "0.4.0.dev202504161719"
9
9
  name = "airbyte-source-google-drive"
10
10
  description = "Source implementation for Google Drive."
11
11
  authors = [
@@ -31,7 +31,7 @@ google-api-python-client-stubs = "==1.18.0"
31
31
  extras = [
32
32
  "file-based",
33
33
  ]
34
- version = "6.45.0.dev04107"
34
+ version = "6.45.4.post49.dev14495925594"
35
35
 
36
36
  [tool.poetry.scripts]
37
37
  source-google-drive = "source_google_drive.run:run"
@@ -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,