Skip to content

Commit ef2ce1e

Browse files
committed
get the correct stream in run_test_read
1 parent 51cfea5 commit ef2ce1e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

airbyte_cdk/connector_builder/connector_builder_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def read_stream(
108108
stream_name = configured_catalog.streams[0].stream.name
109109

110110
stream_read = test_read_handler.run_test_read(
111-
source, config, configured_catalog, state, limits.max_records
111+
source, config, configured_catalog, stream_name, state, limits.max_records,
112112
)
113113

114114
return AirbyteMessage(

airbyte_cdk/connector_builder/test_reader/reader.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ def run_test_read(
8686
source: DeclarativeSource,
8787
config: Mapping[str, Any],
8888
configured_catalog: ConfiguredAirbyteCatalog,
89+
stream_name: str,
8990
state: List[AirbyteStateMessage],
9091
record_limit: Optional[int] = None,
9192
) -> StreamRead:
@@ -112,7 +113,8 @@ def run_test_read(
112113

113114
record_limit = self._check_record_limit(record_limit)
114115
# The connector builder currently only supports reading from a single stream at a time
115-
stream = source.streams(config)[0]
116+
streams = source.streams(config)
117+
stream = next(stream for stream in streams if stream.name == stream_name)
116118

117119
# get any deprecation warnings during the component creation
118120
deprecation_warnings: List[LogMessage] = source.deprecation_warnings()

0 commit comments

Comments
 (0)