airbyte-cdk 6.26.0.dev4102__py3-none-any.whl → 6.26.0.dev4104__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.
@@ -31,10 +31,8 @@ class DeliverRecords(BaseModel):
31
31
  default=False,
32
32
  airbyte_hidden=True,
33
33
  )
34
- identities: Optional[IdentitiesStreamConfig] = Field(
35
- title="Identities configuration",
36
- description="Configuration for identities",
37
- airbyte_hidden=True,
34
+ domain: Optional[str] = Field(
35
+ title="Domain", description="The domain of the identities.", airbyte_hidden=True
38
36
  )
39
37
 
40
38
 
@@ -33,9 +33,6 @@ from airbyte_cdk.sources.file_based.config.file_based_stream_config import (
33
33
  FileBasedStreamConfig,
34
34
  ValidationPolicy,
35
35
  )
36
- from airbyte_cdk.sources.file_based.config.identities_based_stream_config import (
37
- IdentitiesStreamConfig,
38
- )
39
36
  from airbyte_cdk.sources.file_based.discovery_policy import (
40
37
  AbstractDiscoveryPolicy,
41
38
  DefaultDiscoveryPolicy,
@@ -64,6 +61,7 @@ from airbyte_cdk.sources.file_based.stream.concurrent.cursor import (
64
61
  FileBasedFinalStateCursor,
65
62
  )
66
63
  from airbyte_cdk.sources.file_based.stream.cursor import AbstractFileBasedCursor
64
+ from airbyte_cdk.sources.file_based.stream.identities_stream import IDENTITIES_STREAM_NAME
67
65
  from airbyte_cdk.sources.message.repository import InMemoryMessageRepository, MessageRepository
68
66
  from airbyte_cdk.sources.streams import Stream
69
67
  from airbyte_cdk.sources.streams.concurrent.cursor import CursorField
@@ -73,6 +71,7 @@ from airbyte_cdk.utils.traced_exception import AirbyteTracedException
73
71
  DEFAULT_CONCURRENCY = 100
74
72
  MAX_CONCURRENCY = 100
75
73
  INITIAL_N_PARTITIONS = MAX_CONCURRENCY // 2
74
+ IDENTITIES_STREAM = "identities"
76
75
 
77
76
 
78
77
  class FileBasedSource(ConcurrentSourceAdapter, ABC):
@@ -301,11 +300,8 @@ class FileBasedSource(ConcurrentSourceAdapter, ABC):
301
300
 
302
301
  streams.append(stream)
303
302
 
304
- identities_stream_config = self._get_identities_stream_config(parsed_config)
305
- if identities_stream_config:
306
- identities_stream = self._make_identities_stream(
307
- stream_config=identities_stream_config
308
- )
303
+ if self._sync_acl_permissions(parsed_config):
304
+ identities_stream = self._make_identities_stream()
309
305
  streams.append(identities_stream)
310
306
  return streams
311
307
 
@@ -335,11 +331,9 @@ class FileBasedSource(ConcurrentSourceAdapter, ABC):
335
331
 
336
332
  def _make_identities_stream(
337
333
  self,
338
- stream_config: IdentitiesStreamConfig,
339
334
  ) -> Stream:
340
335
  return IdentitiesStream(
341
- config=stream_config,
342
- catalog_schema=self.stream_schemas.get(stream_config.name),
336
+ catalog_schema=self.stream_schemas.get(IDENTITIES_STREAM_NAME),
343
337
  stream_reader=self.stream_reader,
344
338
  discovery_policy=self.discovery_policy,
345
339
  errors_collector=self.errors_collector,
@@ -457,18 +451,3 @@ class FileBasedSource(ConcurrentSourceAdapter, ABC):
457
451
  ):
458
452
  return parsed_config.delivery_method.sync_acl_permissions
459
453
  return False
460
-
461
- @staticmethod
462
- def _get_identities_stream_config(
463
- parsed_config: AbstractFileBasedSpec,
464
- ) -> Optional[IdentitiesStreamConfig]:
465
- identities_stream_config = None
466
- if (
467
- FileBasedSource._sync_acl_permissions(parsed_config)
468
- and hasattr(parsed_config.delivery_method, "identities")
469
- and parsed_config.delivery_method.identities is not None
470
- and isinstance(parsed_config.delivery_method.identities, IdentitiesStreamConfig)
471
- and parsed_config.delivery_method.identities.domain
472
- ):
473
- identities_stream_config = parsed_config.delivery_method.identities
474
- return identities_stream_config
@@ -210,7 +210,7 @@ class AbstractFileBasedStreamReader(ABC):
210
210
  """
211
211
  return {}
212
212
 
213
- def load_identity_groups(self) -> Iterable[Dict[str, Any]]:
213
+ def load_identity_groups(self, logger: logging.Logger) -> Iterable[Dict[str, Any]]:
214
214
  """
215
215
  This is required for connectors that will support syncing
216
216
  identities.
@@ -25,6 +25,8 @@ from airbyte_cdk.sources.streams.core import JsonSchema
25
25
  from airbyte_cdk.sources.utils.record_helper import stream_data_to_airbyte_message
26
26
  from airbyte_cdk.utils.traced_exception import AirbyteTracedException
27
27
 
28
+ IDENTITIES_STREAM_NAME = "identities"
29
+
28
30
 
29
31
  class IdentitiesStream(Stream):
30
32
  """
@@ -36,14 +38,12 @@ class IdentitiesStream(Stream):
36
38
 
37
39
  def __init__(
38
40
  self,
39
- config: IdentitiesStreamConfig,
40
41
  catalog_schema: Optional[Mapping[str, Any]],
41
42
  stream_reader: AbstractFileBasedStreamReader,
42
43
  discovery_policy: AbstractDiscoveryPolicy,
43
44
  errors_collector: FileBasedErrorsCollector,
44
45
  ):
45
46
  super().__init__()
46
- self.config = config
47
47
  self.catalog_schema = catalog_schema
48
48
  self.stream_reader = stream_reader
49
49
  self._discovery_policy = discovery_policy
@@ -71,7 +71,7 @@ class IdentitiesStream(Stream):
71
71
  stream_state: Optional[Mapping[str, Any]] = None,
72
72
  ) -> Iterable[Mapping[str, Any] | AirbyteMessage]:
73
73
  try:
74
- identity_groups = self.stream_reader.load_identity_groups()
74
+ identity_groups = self.stream_reader.load_identity_groups(logger=self.logger)
75
75
  for record in identity_groups:
76
76
  yield stream_data_to_airbyte_message(self.name, record)
77
77
  except AirbyteTracedException as exc:
@@ -93,7 +93,7 @@ class IdentitiesStream(Stream):
93
93
 
94
94
  @property
95
95
  def name(self) -> str:
96
- return self.config.name
96
+ return IDENTITIES_STREAM_NAME
97
97
 
98
98
  def get_cursor(self) -> Optional[Cursor]:
99
99
  return None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: airbyte-cdk
3
- Version: 6.26.0.dev4102
3
+ Version: 6.26.0.dev4104
4
4
  Summary: A framework for writing Airbyte Connectors.
5
5
  License: MIT
6
6
  Keywords: airbyte,connector-development-kit,cdk
@@ -201,7 +201,7 @@ airbyte_cdk/sources/file_based/availability_strategy/__init__.py,sha256=ddKQfUmk
201
201
  airbyte_cdk/sources/file_based/availability_strategy/abstract_file_based_availability_strategy.py,sha256=01Nd4b7ERAbp-OZo_8rrAzFXWPTMwr02SnWiN17nx8Q,2363
202
202
  airbyte_cdk/sources/file_based/availability_strategy/default_file_based_availability_strategy.py,sha256=j9T5TimfWFUz7nqsaj-83G3xWmDpsmeSbDnaUNmz0UM,5849
203
203
  airbyte_cdk/sources/file_based/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
204
- airbyte_cdk/sources/file_based/config/abstract_file_based_spec.py,sha256=891uAzErUPQIPqr9mdzNBdU5aXGHCFCH4X64puVzQvI,7402
204
+ airbyte_cdk/sources/file_based/config/abstract_file_based_spec.py,sha256=1SSOVUW-8ruX0z4enI1LD108GksSwQNBYSYdwV8xaak,7345
205
205
  airbyte_cdk/sources/file_based/config/avro_format.py,sha256=NxTF96ewzn6HuhgodsY7Rpb-ybr1ZEWW5d4Vid64g5A,716
206
206
  airbyte_cdk/sources/file_based/config/csv_format.py,sha256=NWekkyT8dTwiVK0mwa_krQD4FJPHSDfILo8kPAg3-Vs,8006
207
207
  airbyte_cdk/sources/file_based/config/excel_format.py,sha256=9qAmTsT6SoVzNfNv0oBVkVCmiyqQuVAbfRKajjoa7Js,378
@@ -215,8 +215,8 @@ airbyte_cdk/sources/file_based/discovery_policy/__init__.py,sha256=gl3ey6mZbyfra
215
215
  airbyte_cdk/sources/file_based/discovery_policy/abstract_discovery_policy.py,sha256=dCfXX529Rd5rtopg4VeEgTPJjFtqjtjzPq6LCw18Wt0,605
216
216
  airbyte_cdk/sources/file_based/discovery_policy/default_discovery_policy.py,sha256=-xujTidtrq6HC00WKbjQh1CZdT5LMuzkp5BLjqDmfTY,1007
217
217
  airbyte_cdk/sources/file_based/exceptions.py,sha256=WP0qkG6fpWoBpOyyicgp5YNE393VWyegq5qSy0v4QtM,7362
218
- airbyte_cdk/sources/file_based/file_based_source.py,sha256=EQSua5n3OihEt95ROCmdv7pVLCZfdNn4jxJKyLvhMR0,20267
219
- airbyte_cdk/sources/file_based/file_based_stream_reader.py,sha256=5TOUfVas5wiH7PaR5hrFfJFpbx12tAvBDLQy2xzFNJ0,8012
218
+ airbyte_cdk/sources/file_based/file_based_source.py,sha256=4zaMKFcNBvHKJsymSXhpBLE1uW9ea9lua8-EV_2_Yrg,19362
219
+ airbyte_cdk/sources/file_based/file_based_stream_reader.py,sha256=5xcCnTd_zaMVBL1Xp215JAiyNQBf4wAs_WwVgcLi2l4,8036
220
220
  airbyte_cdk/sources/file_based/file_types/__init__.py,sha256=blCLn0-2LC-ZdgcNyDEhqM2RiUvEjEBh-G4-t32ZtuM,1268
221
221
  airbyte_cdk/sources/file_based/file_types/avro_parser.py,sha256=XNx-JC-sgzH9u3nOJ2M59FxBXvtig8LN6BIkeDOavZA,10858
222
222
  airbyte_cdk/sources/file_based/file_types/csv_parser.py,sha256=QlCXB-ry3np67Q_VerQEPoWDOTcPTB6Go4ydZxY9ae4,20445
@@ -243,7 +243,7 @@ airbyte_cdk/sources/file_based/stream/cursor/__init__.py,sha256=MhFB5hOo8sjwvCh8
243
243
  airbyte_cdk/sources/file_based/stream/cursor/abstract_file_based_cursor.py,sha256=om-x3gZFPgWDpi15S9RxZmR36VHnk8sytgN6LlBQhAw,1934
244
244
  airbyte_cdk/sources/file_based/stream/cursor/default_file_based_cursor.py,sha256=VGV7xLyBribuBMVrXtO1xqkWJD86bl7yhXtjnwLMohM,7051
245
245
  airbyte_cdk/sources/file_based/stream/default_file_based_stream.py,sha256=SFb1UXtJtaqo-1t7hM3ahM1ZTH2k01oqX1mAJvz08Y0,19529
246
- airbyte_cdk/sources/file_based/stream/identities_stream.py,sha256=hDb_XgfD6d42mVVMMRwUg7t3CTGOmHGVspoqjNha_Gc,3763
246
+ airbyte_cdk/sources/file_based/stream/identities_stream.py,sha256=2mzXPZ9aXFzr9KlbwDrosXEa-MlShPi-CwAyxZDYpM8,3757
247
247
  airbyte_cdk/sources/file_based/types.py,sha256=INxG7OPnkdUP69oYNKMAbwhvV1AGvLRHs1J6pIia2FI,218
248
248
  airbyte_cdk/sources/http_config.py,sha256=OBZeuyFilm6NlDlBhFQvHhTWabEvZww6OHDIlZujIS0,730
249
249
  airbyte_cdk/sources/http_logger.py,sha256=l_1fk5YwdonZ1wvAsTwjj6d36fj2WrVraIAMj5jTQdM,1575
@@ -353,8 +353,8 @@ airbyte_cdk/utils/slice_hasher.py,sha256=-pHexlNYoWYPnXNH-M7HEbjmeJe9Zk7SJijdQ7d
353
353
  airbyte_cdk/utils/spec_schema_transformations.py,sha256=-5HTuNsnDBAhj-oLeQXwpTGA0HdcjFOf2zTEMUTTg_Y,816
354
354
  airbyte_cdk/utils/stream_status_utils.py,sha256=ZmBoiy5HVbUEHAMrUONxZvxnvfV9CesmQJLDTAIWnWw,1171
355
355
  airbyte_cdk/utils/traced_exception.py,sha256=C8uIBuCL_E4WnBAOPSxBicD06JAldoN9fGsQDp463OY,6292
356
- airbyte_cdk-6.26.0.dev4102.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
357
- airbyte_cdk-6.26.0.dev4102.dist-info/METADATA,sha256=gtF4bkA79n-3Qpw6hYkCkH2N7t6RlXxprSdcb_wkj8c,6004
358
- airbyte_cdk-6.26.0.dev4102.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
359
- airbyte_cdk-6.26.0.dev4102.dist-info/entry_points.txt,sha256=fj-e3PAQvsxsQzyyq8UkG1k8spunWnD4BAH2AwlR6NM,95
360
- airbyte_cdk-6.26.0.dev4102.dist-info/RECORD,,
356
+ airbyte_cdk-6.26.0.dev4104.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
357
+ airbyte_cdk-6.26.0.dev4104.dist-info/METADATA,sha256=4oX2RCzBDRcZ3BZT7mxsy8fP0uCM5hM0tX-qU47OvHk,6004
358
+ airbyte_cdk-6.26.0.dev4104.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
359
+ airbyte_cdk-6.26.0.dev4104.dist-info/entry_points.txt,sha256=fj-e3PAQvsxsQzyyq8UkG1k8spunWnD4BAH2AwlR6NM,95
360
+ airbyte_cdk-6.26.0.dev4104.dist-info/RECORD,,