airbyte-source-azure-blob-storage 0.4.1__py3-none-any.whl → 0.4.2__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-azure-blob-storage might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: airbyte-source-azure-blob-storage
3
- Version: 0.4.1
3
+ Version: 0.4.2
4
4
  Summary: Source implementation for Azure Blob Storage.
5
5
  Home-page: https://airbyte.com
6
6
  License: MIT
@@ -0,0 +1,10 @@
1
+ source_azure_blob_storage/__init__.py,sha256=Wx4PzvHg900-c2CpOOP1Wk0zcJpNVqJrkMnPtDcuaQM,319
2
+ source_azure_blob_storage/config_migrations.py,sha256=NPDwQTWaR2IDOBTEm3Np-S0Gz1phRWbxK-Du8hE2icg,4328
3
+ source_azure_blob_storage/run.py,sha256=muonwvccXCFHBX-MTKFJXgvUGmPWmcrDLSDXhY218YU,2009
4
+ source_azure_blob_storage/source.py,sha256=oExhGYkZh8irsFGBBcCnC2l_TDZ1k-qbRLe1Xd41kjs,2481
5
+ source_azure_blob_storage/spec.py,sha256=DqnKiB_y9PUIQRVzU8bozsdyPIkeJuHCcbMwf-MVtmA,3969
6
+ source_azure_blob_storage/stream_reader.py,sha256=0s9hEeus4Bs1rT4I2fetXEcBwAuTKpt0kWCT3qzz4O8,4629
7
+ airbyte_source_azure_blob_storage-0.4.2.dist-info/METADATA,sha256=-csV1t2RgVs966GYBAw7-zMc4rKf8xli5HV10v2BKKs,6246
8
+ airbyte_source_azure_blob_storage-0.4.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
9
+ airbyte_source_azure_blob_storage-0.4.2.dist-info/entry_points.txt,sha256=75v_DA_Xu0qr0eqtEXyh8sPCqcL9eXKWY8UwdST3ANE,79
10
+ airbyte_source_azure_blob_storage-0.4.2.dist-info/RECORD,,
@@ -2,9 +2,8 @@
2
2
  # Copyright (c) 2023 Airbyte, Inc., all rights reserved.
3
3
  #
4
4
 
5
- from typing import Any, Mapping
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
@@ -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(
@@ -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
- for prefix in prefixes:
84
- for blob in self.azure_container_client.list_blobs(name_starts_with=prefix):
85
- remote_file = RemoteFile(uri=blob.name, last_modified=blob.last_modified.astimezone(pytz.utc).replace(tzinfo=None))
86
- yield from self.filter_files_by_globs_and_start_date([remote_file], globs)
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:
@@ -1,10 +0,0 @@
1
- source_azure_blob_storage/__init__.py,sha256=Wx4PzvHg900-c2CpOOP1Wk0zcJpNVqJrkMnPtDcuaQM,319
2
- source_azure_blob_storage/config_migrations.py,sha256=NPDwQTWaR2IDOBTEm3Np-S0Gz1phRWbxK-Du8hE2icg,4328
3
- source_azure_blob_storage/run.py,sha256=muonwvccXCFHBX-MTKFJXgvUGmPWmcrDLSDXhY218YU,2009
4
- source_azure_blob_storage/source.py,sha256=wDPZ79Xv-YYWADwHGtlK9QfuY5hbuhypkRn62A1hw8s,2579
5
- source_azure_blob_storage/spec.py,sha256=eQ_S79CYC89r214ldUG3nIN-eWBtm3iM5o89VeuBJGw,3969
6
- source_azure_blob_storage/stream_reader.py,sha256=zBf72C4uCq0BplAK6EjJ5MoZDLrNZ_PNdCBFe7LnnoY,4261
7
- airbyte_source_azure_blob_storage-0.4.1.dist-info/METADATA,sha256=xSuRU5ZQC7C8_CDW_pkYdLz8Jv1bp8yM-5GWBvuSuoE,6246
8
- airbyte_source_azure_blob_storage-0.4.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
9
- airbyte_source_azure_blob_storage-0.4.1.dist-info/entry_points.txt,sha256=75v_DA_Xu0qr0eqtEXyh8sPCqcL9eXKWY8UwdST3ANE,79
10
- airbyte_source_azure_blob_storage-0.4.1.dist-info/RECORD,,