Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UI] Support exporting pod stdout and result #399

Merged
merged 2 commits into from
Jul 28, 2023

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.

@@ -794,6 +794,8 @@ function CanvasImpl() {
cellList = JSON.parse(String(fileContent)).cells.map((cell) => ({
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