airbyte-cdk 6.48.13__py3-none-any.whl → 6.48.14.post1.dev15054311822__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.
@@ -88,6 +88,9 @@ class LegacyToPerPartitionStateMigration(StateMigration):
88
88
  if keys[0] != self._cursor_field:
89
89
  # Unexpected key. Found {keys[0]}. Expected {self._cursor.cursor_field}
90
90
  return False
91
+ # it is expected the internal value to be a dictionary according to docstring
92
+ else:
93
+ return False
91
94
  return True
92
95
 
93
96
  def migrate(self, stream_state: Mapping[str, Any]) -> Mapping[str, Any]:
@@ -928,9 +928,9 @@ class ModelToComponentFactory:
928
928
  declarative_stream: DeclarativeStreamModel,
929
929
  ) -> LegacyToPerPartitionStateMigration:
930
930
  retriever = declarative_stream.retriever
931
- if not isinstance(retriever, SimpleRetrieverModel):
931
+ if not isinstance(retriever, (SimpleRetrieverModel, AsyncRetrieverModel)):
932
932
  raise ValueError(
933
- f"LegacyToPerPartitionStateMigrations can only be applied on a DeclarativeStream with a SimpleRetriever. Got {type(retriever)}"
933
+ f"LegacyToPerPartitionStateMigrations can only be applied on a DeclarativeStream with a SimpleRetriever or AsyncRetriever. Got {type(retriever)}"
934
934
  )
935
935
  partition_router = retriever.partition_router
936
936
  if not isinstance(
@@ -1484,6 +1484,7 @@ class ModelToComponentFactory:
1484
1484
  stream_state_migrations=stream_state_migrations,
1485
1485
  )
1486
1486
  )
1487
+
1487
1488
  stream_state = self.apply_stream_state_migrations(stream_state_migrations, stream_state)
1488
1489
  # Per-partition state doesn't make sense for GroupingPartitionRouter, so force the global state
1489
1490
  use_global_cursor = isinstance(
@@ -1993,14 +1994,31 @@ class ModelToComponentFactory:
1993
1994
  ) -> Optional[StreamSlicer]:
1994
1995
  if model.incremental_sync and stream_slicer:
1995
1996
  if model.retriever.type == "AsyncRetriever":
1997
+ stream_name = model.name or ""
1998
+ stream_namespace = None
1999
+ stream_state = self._connector_state_manager.get_stream_state(
2000
+ stream_name, stream_namespace
2001
+ )
2002
+ state_transformations = (
2003
+ [
2004
+ self._create_component_from_model(
2005
+ state_migration, config, declarative_stream=model
2006
+ )
2007
+ for state_migration in model.state_migrations
2008
+ ]
2009
+ if model.state_migrations
2010
+ else []
2011
+ )
2012
+
1996
2013
  return self.create_concurrent_cursor_from_perpartition_cursor( # type: ignore # This is a known issue that we are creating and returning a ConcurrentCursor which does not technically implement the (low-code) StreamSlicer. However, (low-code) StreamSlicer and ConcurrentCursor both implement StreamSlicer.stream_slices() which is the primary method needed for checkpointing
1997
2014
  state_manager=self._connector_state_manager,
1998
2015
  model_type=DatetimeBasedCursorModel,
1999
2016
  component_definition=model.incremental_sync.__dict__,
2000
- stream_name=model.name or "",
2001
- stream_namespace=None,
2017
+ stream_name=stream_name,
2018
+ stream_namespace=stream_namespace,
2002
2019
  config=config or {},
2003
- stream_state={},
2020
+ stream_state=stream_state,
2021
+ stream_state_migrations=state_transformations,
2004
2022
  partition_router=stream_slicer,
2005
2023
  )
2006
2024
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: airbyte-cdk
3
- Version: 6.48.13
3
+ Version: 6.48.14.post1.dev15054311822
4
4
  Summary: A framework for writing Airbyte Connectors.
5
5
  Home-page: https://airbyte.com
6
6
  License: MIT
@@ -129,7 +129,7 @@ airbyte_cdk/sources/declarative/interpolation/jinja.py,sha256=UQeuS4Vpyp4hlOn-R3
129
129
  airbyte_cdk/sources/declarative/interpolation/macros.py,sha256=UYSJ5gW7TkHALYnNvUnRP3RlyGwGuRMObF3BHuNzjJM,5320
130
130
  airbyte_cdk/sources/declarative/manifest_declarative_source.py,sha256=cZNUOeIogrCmCS7RXeJqQIlnsANigz1cngpLko02M2g,23191
131
131
  airbyte_cdk/sources/declarative/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
132
- airbyte_cdk/sources/declarative/migrations/legacy_to_per_partition_state_migration.py,sha256=iemy3fKLczcU0-Aor7tx5jcT6DRedKMqyK7kCOp01hg,3924
132
+ airbyte_cdk/sources/declarative/migrations/legacy_to_per_partition_state_migration.py,sha256=9GiDuR4Fs8_tBlf15KlUj_rwJA1X0li5cpwrLw9tKqw,4073
133
133
  airbyte_cdk/sources/declarative/migrations/state_migration.py,sha256=KWPjealMLKSMtajXgkdGgKg7EmTLR-CqqD7UIh0-eDU,794
134
134
  airbyte_cdk/sources/declarative/models/__init__.py,sha256=nUFxNCiKeYRVXuZEKA7GD-lTHxsiKcQ8FitZjKhPIvE,100
135
135
  airbyte_cdk/sources/declarative/models/base_model_with_deprecations.py,sha256=Imnj3yef0aqRdLfaUxkIYISUb8YkiPrRH_wBd-x8HjM,5999
@@ -140,7 +140,7 @@ airbyte_cdk/sources/declarative/parsers/custom_exceptions.py,sha256=wnRUP0Xeru9R
140
140
  airbyte_cdk/sources/declarative/parsers/manifest_component_transformer.py,sha256=2UdpCz3yi7ISZTyqkQXSSy3dMxeyOWqV7OlAS5b9GVg,11568
141
141
  airbyte_cdk/sources/declarative/parsers/manifest_normalizer.py,sha256=laBy7ebjA-PiNwc-50U4FHvMqS_mmHvnabxgFs4CjGw,17069
142
142
  airbyte_cdk/sources/declarative/parsers/manifest_reference_resolver.py,sha256=pJmg78vqE5VfUrF_KJnWjucQ4k9IWFULeAxHCowrHXE,6806
143
- airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py,sha256=Ai-3RfSoBa3oNc34KNlUvp7KbbQuuqhtGwGOxPf8fMc,167671
143
+ airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py,sha256=uPefJHWYdLxupSVqI4_VnU30JlbA44EQ7GwY0RdfaVw,168443
144
144
  airbyte_cdk/sources/declarative/partition_routers/__init__.py,sha256=TBC9AkGaUqHm2IKHMPN6punBIcY5tWGULowcLoAVkfw,1109
145
145
  airbyte_cdk/sources/declarative/partition_routers/async_job_partition_router.py,sha256=VelO7zKqKtzMJ35jyFeg0ypJLQC0plqqIBNXoBW1G2E,3001
146
146
  airbyte_cdk/sources/declarative/partition_routers/cartesian_product_stream_slicer.py,sha256=c5cuVFM6NFkuQqG8Z5IwkBuwDrvXZN1CunUOM_L0ezg,6892
@@ -419,9 +419,9 @@ airbyte_cdk/utils/slice_hasher.py,sha256=EDxgROHDbfG-QKQb59m7h_7crN1tRiawdf5uU7G
419
419
  airbyte_cdk/utils/spec_schema_transformations.py,sha256=-5HTuNsnDBAhj-oLeQXwpTGA0HdcjFOf2zTEMUTTg_Y,816
420
420
  airbyte_cdk/utils/stream_status_utils.py,sha256=ZmBoiy5HVbUEHAMrUONxZvxnvfV9CesmQJLDTAIWnWw,1171
421
421
  airbyte_cdk/utils/traced_exception.py,sha256=C8uIBuCL_E4WnBAOPSxBicD06JAldoN9fGsQDp463OY,6292
422
- airbyte_cdk-6.48.13.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
423
- airbyte_cdk-6.48.13.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
424
- airbyte_cdk-6.48.13.dist-info/METADATA,sha256=GdzqhkyDm8Slz4AKF7xh6l6TPhz8xKHsFG8qrb_AtA4,6344
425
- airbyte_cdk-6.48.13.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
426
- airbyte_cdk-6.48.13.dist-info/entry_points.txt,sha256=AKWbEkHfpzzk9nF9tqBUaw1MbvTM4mGtEzmZQm0ZWvM,139
427
- airbyte_cdk-6.48.13.dist-info/RECORD,,
422
+ airbyte_cdk-6.48.14.post1.dev15054311822.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
423
+ airbyte_cdk-6.48.14.post1.dev15054311822.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
424
+ airbyte_cdk-6.48.14.post1.dev15054311822.dist-info/METADATA,sha256=AzS8LkzcmckHJwt9xfEGjZSUr6qLxmLh-3Lrz6GGm7g,6365
425
+ airbyte_cdk-6.48.14.post1.dev15054311822.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
426
+ airbyte_cdk-6.48.14.post1.dev15054311822.dist-info/entry_points.txt,sha256=AKWbEkHfpzzk9nF9tqBUaw1MbvTM4mGtEzmZQm0ZWvM,139
427
+ airbyte_cdk-6.48.14.post1.dev15054311822.dist-info/RECORD,,