Skip to content

Commit c92b9f8

Browse files
committed
handle case where stream is not found
1 parent ef2ce1e commit c92b9f8

File tree

1 file changed

+3
-3
lines changed
  • airbyte_cdk/connector_builder/test_reader

1 file changed

+3
-3
lines changed

airbyte_cdk/connector_builder/test_reader/reader.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,14 @@ def run_test_read(
114114
record_limit = self._check_record_limit(record_limit)
115115
# The connector builder currently only supports reading from a single stream at a time
116116
streams = source.streams(config)
117-
stream = next(stream for stream in streams if stream.name == stream_name)
117+
stream = next((stream for stream in streams if stream.name == stream_name), None)
118118

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

122122
schema_inferrer = SchemaInferrer(
123-
self._pk_to_nested_and_composite_field(stream.primary_key),
124-
self._cursor_field_to_nested_and_composite_field(stream.cursor_field),
123+
self._pk_to_nested_and_composite_field(stream.primary_key) if stream else None,
124+
self._cursor_field_to_nested_and_composite_field(stream.cursor_field) if stream else None,
125125
)
126126
datetime_format_inferrer = DatetimeFormatInferrer()
127127

0 commit comments

Comments
 (0)