File tree Expand file tree Collapse file tree 4 files changed +8
-6
lines changed
file_based/stream/concurrent
unit_tests/sources/streams/concurrent Expand file tree Collapse file tree 4 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 3232from airbyte_cdk .sources .message import MessageRepository
3333from airbyte_cdk .sources .source import ExperimentalClassWarning
3434from airbyte_cdk .sources .streams .concurrent .abstract_stream_facade import AbstractStreamFacade
35+ from airbyte_cdk .sources .streams .concurrent .cursor import CursorField
3536from airbyte_cdk .sources .streams .concurrent .default_stream import DefaultStream
3637from airbyte_cdk .sources .streams .concurrent .exceptions import ExceptionWithDisplayMessage
3738from airbyte_cdk .sources .streams .concurrent .helpers import (
@@ -97,7 +98,7 @@ def create_from_stream(
9798 name = stream .name ,
9899 json_schema = stream .get_json_schema (),
99100 primary_key = pk ,
100- cursor_field = cursor_field ,
101+ cursor_field = CursorField ( cursor_field_key = cursor_field ) if cursor_field else None ,
101102 logger = logger ,
102103 namespace = stream .namespace ,
103104 cursor = cursor ,
Original file line number Diff line number Diff line change 2525from airbyte_cdk .sources .source import ExperimentalClassWarning
2626from airbyte_cdk .sources .streams import Stream
2727from airbyte_cdk .sources .streams .concurrent .abstract_stream_facade import AbstractStreamFacade
28- from airbyte_cdk .sources .streams .concurrent .cursor import Cursor , FinalStateCursor
28+ from airbyte_cdk .sources .streams .concurrent .cursor import Cursor , CursorField , FinalStateCursor
2929from airbyte_cdk .sources .streams .concurrent .default_stream import DefaultStream
3030from airbyte_cdk .sources .streams .concurrent .exceptions import ExceptionWithDisplayMessage
3131from airbyte_cdk .sources .streams .concurrent .helpers import (
@@ -97,7 +97,7 @@ def create_from_stream(
9797 namespace = stream .namespace ,
9898 json_schema = stream .get_json_schema (),
9999 primary_key = pk ,
100- cursor_field = cursor_field ,
100+ cursor_field = CursorField ( cursor_field_key = cursor_field ) if cursor_field else None ,
101101 logger = logger ,
102102 cursor = cursor ,
103103 ),
Original file line number Diff line number Diff line change 2222 StreamPartition ,
2323 StreamPartitionGenerator ,
2424)
25- from airbyte_cdk .sources .streams .concurrent .cursor import Cursor
25+ from airbyte_cdk .sources .streams .concurrent .cursor import Cursor , CursorField
2626from airbyte_cdk .sources .streams .concurrent .exceptions import ExceptionWithDisplayMessage
2727from airbyte_cdk .sources .streams .core import Stream
2828from airbyte_cdk .sources .types import Record
@@ -328,6 +328,7 @@ def test_create_from_stream_stream(self):
328328
329329 assert facade .name == "stream"
330330 assert facade .cursor_field == "cursor"
331+ # assert facade.cursor_field == CursorField(cursor_field_key="cursor")
331332 assert facade ._abstract_stream ._primary_key == ["id" ]
332333
333334 def test_create_from_stream_stream_with_none_primary_key (self ):
Original file line number Diff line number Diff line change 88
99from airbyte_cdk .models import AirbyteStream , SyncMode
1010from airbyte_cdk .sources .message import InMemoryMessageRepository
11- from airbyte_cdk .sources .streams .concurrent .cursor import Cursor , FinalStateCursor
11+ from airbyte_cdk .sources .streams .concurrent .cursor import Cursor , CursorField , FinalStateCursor
1212from airbyte_cdk .sources .streams .concurrent .default_stream import DefaultStream
1313from airbyte_cdk .sources .streams .concurrent .partitions .partition import Partition
1414from airbyte_cdk .sources .streams .concurrent .partitions .partition_generator import PartitionGenerator
@@ -187,7 +187,7 @@ def test_as_airbyte_stream_with_a_cursor(self):
187187 self ._name ,
188188 json_schema ,
189189 self ._primary_key ,
190- "date" ,
190+ CursorField ( cursor_field_key = "date" ) ,
191191 self ._logger ,
192192 FinalStateCursor (
193193 stream_name = self ._name ,
You can’t perform that action at this time.
0 commit comments