|
44 | 44 | from airbyte_cdk.sources.source import TState |
45 | 45 | from airbyte_cdk.sources.streams import Stream |
46 | 46 | from airbyte_cdk.sources.streams.concurrent.abstract_stream import AbstractStream |
| 47 | +from airbyte_cdk.sources.streams.concurrent.abstract_stream_facade import AbstractStreamFacade |
47 | 48 | from airbyte_cdk.sources.streams.concurrent.availability_strategy import ( |
48 | 49 | AlwaysAvailableAvailabilityStrategy, |
49 | 50 | ) |
@@ -118,6 +119,12 @@ def __init__( |
118 | 119 | message_repository=self.message_repository, |
119 | 120 | ) |
120 | 121 |
|
| 122 | + # TODO: Remove this. This property is necessary to safely migrate Stripe during the transition state. |
| 123 | + @property |
| 124 | + def is_partially_declarative(self) -> bool: |
| 125 | + """This flag used to avoid unexpected AbstractStreamFacade processing as concurrent streams.""" |
| 126 | + return False |
| 127 | + |
121 | 128 | def read( |
122 | 129 | self, |
123 | 130 | logger: logging.Logger, |
@@ -369,6 +376,14 @@ def _group_streams( |
369 | 376 | ) |
370 | 377 | else: |
371 | 378 | synchronous_streams.append(declarative_stream) |
| 379 | + # TODO: Remove this. This check is necessary to safely migrate Stripe during the transition state. |
| 380 | + # Condition below needs to ensure that concurrent support is not lost for sources that already support |
| 381 | + # it before migration, but now are only partially migrated to declarative implementation (e.g., Stripe). |
| 382 | + elif ( |
| 383 | + isinstance(declarative_stream, AbstractStreamFacade) |
| 384 | + and self.is_partially_declarative |
| 385 | + ): |
| 386 | + concurrent_streams.append(declarative_stream.get_underlying_stream()) |
372 | 387 | else: |
373 | 388 | synchronous_streams.append(declarative_stream) |
374 | 389 |
|
|
0 commit comments