airbyte-source-azure-blob-storage 0.4.1__tar.gz → 0.4.2__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-azure-blob-storage might be problematic. Click here for more details.
- {airbyte_source_azure_blob_storage-0.4.1 → airbyte_source_azure_blob_storage-0.4.2}/PKG-INFO +1 -1
- {airbyte_source_azure_blob_storage-0.4.1 → airbyte_source_azure_blob_storage-0.4.2}/pyproject.toml +1 -1
- {airbyte_source_azure_blob_storage-0.4.1 → airbyte_source_azure_blob_storage-0.4.2}/source_azure_blob_storage/source.py +1 -2
- {airbyte_source_azure_blob_storage-0.4.1 → airbyte_source_azure_blob_storage-0.4.2}/source_azure_blob_storage/stream_reader.py +10 -4
- {airbyte_source_azure_blob_storage-0.4.1 → airbyte_source_azure_blob_storage-0.4.2}/README.md +0 -0
- {airbyte_source_azure_blob_storage-0.4.1 → airbyte_source_azure_blob_storage-0.4.2}/source_azure_blob_storage/__init__.py +0 -0
- {airbyte_source_azure_blob_storage-0.4.1 → airbyte_source_azure_blob_storage-0.4.2}/source_azure_blob_storage/config_migrations.py +0 -0
- {airbyte_source_azure_blob_storage-0.4.1 → airbyte_source_azure_blob_storage-0.4.2}/source_azure_blob_storage/run.py +0 -0
- {airbyte_source_azure_blob_storage-0.4.1 → airbyte_source_azure_blob_storage-0.4.2}/source_azure_blob_storage/spec.py +6 -6
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
|
|
3
3
|
#
|
|
4
4
|
|
|
5
|
-
from typing import Any
|
|
5
|
+
from typing import Any
|
|
6
6
|
|
|
7
|
-
from airbyte_cdk.config_observation import emit_configuration_as_airbyte_control_message
|
|
8
7
|
from airbyte_cdk.sources.declarative.models import OAuthConfigSpecification
|
|
9
8
|
from airbyte_cdk.sources.file_based.file_based_source import FileBasedSource
|
|
10
9
|
from airbyte_protocol.models import AdvancedAuth, ConnectorSpecification
|
|
@@ -8,7 +8,10 @@ import pytz
|
|
|
8
8
|
from airbyte_cdk.sources.file_based.file_based_stream_reader import AbstractFileBasedStreamReader, FileReadMode
|
|
9
9
|
from airbyte_cdk.sources.file_based.remote_file import RemoteFile
|
|
10
10
|
from airbyte_cdk.sources.streams.http.requests_native_auth import Oauth2Authenticator
|
|
11
|
+
from airbyte_cdk.utils import AirbyteTracedException
|
|
12
|
+
from airbyte_protocol.models import FailureType
|
|
11
13
|
from azure.core.credentials import AccessToken
|
|
14
|
+
from azure.core.exceptions import ResourceNotFoundError
|
|
12
15
|
from azure.storage.blob import BlobServiceClient, ContainerClient
|
|
13
16
|
from smart_open import open
|
|
14
17
|
|
|
@@ -80,10 +83,13 @@ class SourceAzureBlobStorageStreamReader(AbstractFileBasedStreamReader):
|
|
|
80
83
|
) -> Iterable[RemoteFile]:
|
|
81
84
|
prefixes = [prefix] if prefix else self.get_prefixes_from_globs(globs)
|
|
82
85
|
prefixes = prefixes or [None]
|
|
83
|
-
|
|
84
|
-
for
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
try:
|
|
87
|
+
for prefix in prefixes:
|
|
88
|
+
for blob in self.azure_container_client.list_blobs(name_starts_with=prefix):
|
|
89
|
+
remote_file = RemoteFile(uri=blob.name, last_modified=blob.last_modified.astimezone(pytz.utc).replace(tzinfo=None))
|
|
90
|
+
yield from self.filter_files_by_globs_and_start_date([remote_file], globs)
|
|
91
|
+
except ResourceNotFoundError as e:
|
|
92
|
+
raise AirbyteTracedException(failure_type=FailureType.config_error, internal_message=e.message, message=e.reason or e.message)
|
|
87
93
|
|
|
88
94
|
def open_file(self, file: RemoteFile, mode: FileReadMode, encoding: Optional[str], logger: logging.Logger) -> IOBase:
|
|
89
95
|
try:
|
{airbyte_source_azure_blob_storage-0.4.1 → airbyte_source_azure_blob_storage-0.4.2}/README.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -59,17 +59,17 @@ class SourceAzureBlobStorageSpec(AbstractFileBasedSpec):
|
|
|
59
59
|
def documentation_url(cls) -> AnyUrl:
|
|
60
60
|
return AnyUrl("https://docs.airbyte.com/integrations/sources/azure-blob-storage", scheme="https")
|
|
61
61
|
|
|
62
|
-
azure_blob_storage_account_name: str = Field(
|
|
63
|
-
title="Azure Blob Storage account name",
|
|
64
|
-
description="The account's name of the Azure Blob Storage.",
|
|
65
|
-
examples=["airbyte5storage"],
|
|
66
|
-
order=2,
|
|
67
|
-
)
|
|
68
62
|
credentials: Union[Oauth2, StorageAccountKey] = Field(
|
|
69
63
|
title="Authentication",
|
|
70
64
|
description="Credentials for connecting to the Azure Blob Storage",
|
|
71
65
|
discriminator="auth_type",
|
|
72
66
|
type="object",
|
|
67
|
+
order=2,
|
|
68
|
+
)
|
|
69
|
+
azure_blob_storage_account_name: str = Field(
|
|
70
|
+
title="Azure Blob Storage account name",
|
|
71
|
+
description="The account's name of the Azure Blob Storage.",
|
|
72
|
+
examples=["airbyte5storage"],
|
|
73
73
|
order=3,
|
|
74
74
|
)
|
|
75
75
|
azure_blob_storage_container_name: str = Field(
|