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

Marimo is unable to save to PNG for some (not all) notebooks #2821

Open
jamescooke opened this issue Nov 8, 2024 · 3 comments
Open

Marimo is unable to save to PNG for some (not all) notebooks #2821

jamescooke opened this issue Nov 8, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@jamescooke
Copy link

Describe the bug

Saving to PNG fails for some notebooks.

The toaster appears with the error message, but no information is logged to the browser console - no errors, warnings, etc are added.

Environment

{
  "marimo": "0.9.16",
  "OS": "Linux",
  "OS Version": "5.15.0-124-generic",
  "Processor": "x86_64",
  "Python Version": "3.10.13",
  "Binaries": {
    "Browser": "--",
    "Node": "--"
  },
  "Dependencies": {
    "click": "8.1.7",
    "docutils": "0.21.2",
    "itsdangerous": "2.2.0",
    "jedi": "0.19.1",
    "markdown": "3.7",
    "narwhals": "1.13.2",
    "packaging": "24.1",
    "psutil": "6.1.0",
    "pygments": "2.18.0",
    "pymdown-extensions": "10.11.2",
    "pyyaml": "6.0.2",
    "ruff": "0.7.1",
    "starlette": "0.41.0",
    "tomlkit": "0.13.2",
    "typing-extensions": "4.12.2",
    "uvicorn": "0.32.0",
    "websockets": "12.0"
  },
  "Optional Dependencies": {
    "altair": "5.4.1",
    "pandas": "2.2.3",
    "pyarrow": "17.0.0"
  }
}

Code to reproduce

My guess is there's a failure in downloadByUrl here:

downloadByURL(dataUrl, Filenames.toPNG(filename));

But because there's no JS error emitted, I don't know exactly how to reproduce.

I've got a notebook with 2 Pandas DataFrames displayed and 4 Altair charts.

The DataFrames are displayed by returning the DF at the end of the cell as per https://docs.marimo.io/guides/working_with_data/dataframes.html#displaying-dataframes - so I'm assuming they're using mo.ui.table.

When I comment out the DataFrames, then the download works. When I switch to mo.plain(...) to render the DataFrames, then download works.

I don't think there's anything special about the DataFrames apart from they have a "large" number of columns - the first one is 37 columns, but the second one is a limited subset of columns aggregated.

@jamescooke jamescooke added the bug Something isn't working label Nov 8, 2024
@mscolnick
Copy link
Contributor

Thanks for reporting. Are you able to get it to consistently fail? Are you able to share the code? It looks like chrome has a 2mb limit for what we are doing, but Firefox does not. What browser are you using? Can you try safari or Firefox?

@jamescooke
Copy link
Author

Thanks for reporting.

NP 🫡

Are you able to get it to consistently fail?

Yes I think so - I was on Friday and I can check again today.

Are you able to share the code?

Not the exact notebook I have now because it's full of financials, but maybe I can find a way to strip it down.

It looks like chrome has a 2mb limit for what we are doing, but Firefox does not. What browser are you using?

Am on Firefox 132.

Can you try safari or Firefox?

Not sure what other browsers I can try with.

I think there are two possible avenues:

  1. See if it works in another browser, or
  2. Create a shareable notebook that fails.

Not sure what's best to push on.

@mscolnick
Copy link
Contributor

If you can share a similar notebook, I can try in other browsers for you, and it will help us debug the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants