Skip to content

Commit

Permalink
Update nb-check to not clear SQL cell metadata.
Browse files Browse the repository at this point in the history
  • Loading branch information
TitoGrine committed Aug 19, 2023
1 parent 3494007 commit ef61a15
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion resources/nb-check.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,13 @@ def new_markdown_cell(cell_id: str, content: str) -> dict[str, Any]:
# Clear out execution metadata and cell output
for cell in cells:
if 'metadata' in cell:
cell['metadata'] = {}
clean_metadata = {}
if 'language' in cell['metadata']:
clean_metadata['language'] = cell['metadata']['language']
if 'output_variable' in cell['metadata']:
clean_metadata['output_variable'] = cell['metadata']['output_variable']

cell['metadata'] = clean_metadata
if 'outputs' in cell:
cell['outputs'] = []
if 'execution_count' in cell:
Expand Down

0 comments on commit ef61a15

Please sign in to comment.