Skip to content

Commit 3d93736

Browse files
committed
Add output redirection
1 parent e3170a4 commit 3d93736

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

singlestoredb/magics/run_shared.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ def get_cells() -> Any:
105105
if cell.cell_type == 'code':
106106
output_redirect = getattr(
107107
cell, 'metadata', {},
108-
).get('output_variable', '')
108+
).get('output_variable', '') or ''
109109
if output_redirect:
110-
output_redirect = f' << {output_redirect}'
110+
output_redirect = f' {output_redirect} <<'
111111
if getattr(cell, 'metadata', {}).get('language', '') == 'sql':
112112
yield f'%%sql{output_redirect}\n{cell.source}'
113113
else:

0 commit comments

Comments
 (0)