Skip to content

Commit

Permalink
fix for error tabular output table
Browse files Browse the repository at this point in the history
  • Loading branch information
Abellegese committed Jan 16, 2025
1 parent 6cdc93b commit 41f8c14
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ersilia/cli/commands/run.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import json
import types

import click
Expand Down Expand Up @@ -76,14 +77,17 @@ def run(input, output, batch_size, as_table):
if as_table:
print_result_table(iter_values)
else:
echo("\n".join(map(str, iter_values)))
formatted_values = [json.dumps(item) for item in iter_values]
echo("\n".join(formatted_values))
else:
if as_table:
print_result_table(result)
else:
try:
echo(str(result))
echo(result)
except Exception:
print_result_table(result)
echo(
f"Error: Could not print the result for output given path: {result}."
)

return run

0 comments on commit 41f8c14

Please sign in to comment.