Skip to content

Commit b1e12b6

Browse files
feat: add stdout fallback in from_completed_process method
- Handle case when stdout_file is None by falling back to completed_process.stdout - Create EntrypointOutput from captured stdout messages when no file provided - Maintain backward compatibility for both file-based and memory-based stdout - Addresses GitHub PR feedback from @aaronsteers Co-Authored-By: AJ Steers <[email protected]>
1 parent 5823dfc commit b1e12b6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

airbyte_cdk/test/entrypoint_wrapper.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,14 @@ def from_completed_process(
301301
stdout_file: Path | None = None,
302302
) -> "EntrypointOutput":
303303
"""Create EntrypointOutput from a completed subprocess with optional stdout file."""
304-
instance = cls(message_file=stdout_file)
304+
if stdout_file is not None:
305+
instance = cls(message_file=stdout_file)
306+
elif completed_process.stdout:
307+
messages = completed_process.stdout.splitlines()
308+
instance = cls(messages=messages)
309+
else:
310+
instance = cls()
311+
305312
instance._completed_process = completed_process
306313
return instance
307314

0 commit comments

Comments
 (0)