Skip to content

Commit 241a88d

Browse files
committed
fix tests
1 parent d4ab3c3 commit 241a88d

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

airbyte_cdk/sources/file_based/stream/concurrent/adapters.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
from airbyte_cdk.sources.message import MessageRepository
3333
from airbyte_cdk.sources.source import ExperimentalClassWarning
3434
from airbyte_cdk.sources.streams.concurrent.abstract_stream_facade import AbstractStreamFacade
35+
from airbyte_cdk.sources.streams.concurrent.cursor import CursorField
3536
from airbyte_cdk.sources.streams.concurrent.default_stream import DefaultStream
3637
from airbyte_cdk.sources.streams.concurrent.exceptions import ExceptionWithDisplayMessage
3738
from 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,

airbyte_cdk/sources/streams/concurrent/adapters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from airbyte_cdk.sources.source import ExperimentalClassWarning
2626
from airbyte_cdk.sources.streams import Stream
2727
from 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
2929
from airbyte_cdk.sources.streams.concurrent.default_stream import DefaultStream
3030
from airbyte_cdk.sources.streams.concurrent.exceptions import ExceptionWithDisplayMessage
3131
from 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
),

unit_tests/sources/streams/concurrent/test_adapters.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
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
2626
from airbyte_cdk.sources.streams.concurrent.exceptions import ExceptionWithDisplayMessage
2727
from airbyte_cdk.sources.streams.core import Stream
2828
from 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):

unit_tests/sources/streams/concurrent/test_default_stream.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from airbyte_cdk.models import AirbyteStream, SyncMode
1010
from 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
1212
from airbyte_cdk.sources.streams.concurrent.default_stream import DefaultStream
1313
from airbyte_cdk.sources.streams.concurrent.partitions.partition import Partition
1414
from 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,

0 commit comments

Comments
 (0)