Skip to content

Commit

Permalink
Fixed empty stdout error
Browse files Browse the repository at this point in the history
  • Loading branch information
GlassOfWhiskey committed Apr 26, 2022
1 parent b6bf8dc commit 3180b41
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jupyter_workflow/ipython/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ async def run_ast_nodes(self,

async def run_workflow(self, notebook):
result = ExecutionResult(None)
result.stdout = {}
result.out = {}
cells = [self.transform_cell(cell['code']) for cell in notebook['cells']]
with self.builtin_trap, self.display_trap:
try:
Expand Down Expand Up @@ -296,13 +298,11 @@ async def run_workflow(self, notebook):
try:
await StreamFlowExecutor(workflow).run()
# Capture output logs
result.stdout = {}
outputs = await _get_outputs(workflow, executor.CELL_OUTPUT)
for cell_name, token in outputs.items():
if output := _get_stdout(get_token_value(token)):
result.stdout[cell_name] = output
# Capture IPython 'Out' content
result.out = {}
ipython_outs = await _get_outputs(workflow, 'Out')
for cell_name, token in ipython_outs.items():
try:
Expand Down

0 comments on commit 3180b41

Please sign in to comment.