Skip to content

[UI] Support exporting pod stdout and result#399

Merged
lihebi merged 2 commits intocodepod-io:mainfrom
senwang86:pod_metadata_export
Jul 28, 2023
Merged

[UI] Support exporting pod stdout and result#399
lihebi merged 2 commits intocodepod-io:mainfrom
senwang86:pod_metadata_export

Conversation

@senwang86
Copy link
Collaborator

Summary

  • When exporting, the pod's stdout and result are written to a Jupyter notebook
  • "Raw JSON" export functionality is moved to the frontend
  • The Jupyter notebook result is imported in addition to the entire notebook
  • Bug fix: "execution_count" is returned from runtime server now

Test

export_pod_result

import_ipynb_result

@senwang86 senwang86 requested a review from lihebi July 27, 2023 23:22
"href",
"data:text/plain;charset=utf-8," + encodeURIComponent(data.exportJSON)
);
element.setAttribute("download", `${repoName || ""}.json`);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add date to the exported filename and keep consistent with the .ipynb export.

const filename = `${
repoName || "Untitled"
}-${new Date().toISOString()}.ipynb`;

Copy link
Collaborator

@lihebi lihebi Jul 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind, I made this minor change. Merging.

cellType: cell.cell_type,
cellSource: cell.source.join(""),
cellOutputs: cell.outputs || [],
execution_count: cell.execution_count || 0,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should display the execution count in the output area of a Code pod. This PR already gets packed, let's implement it in another PR.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

execution_count is a property of both a code cell and its output (if the output type is execute_result) #411

@lihebi
Copy link
Collaborator

lihebi commented Jul 28, 2023

Thanks, Sen!

@lihebi lihebi merged commit c4652b7 into codepod-io:main Jul 28, 2023
@senwang86 senwang86 deleted the pod_metadata_export branch August 8, 2023 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants