holoviz/lumen

Don't import Dask when Panel serving an app

hoxbro opened this issue · 3 comments

hoxbro commented

Dask is imported when running the following:

import sys
import panel as pn
pn.panel("dask" in sys.modules).servable()

The import is happening here:

import dask.dataframe as dd

Where Lumen is called in Panel here:
https://github.com/holoviz/panel/blob/86a05a3c080d5cd39af7280793db8e6cd42a3783/panel/io/rest.py#L182

hoxbro commented

Running python -X importtime -c "import panel.io.rest" 2> log.txt && tuna log.txt I can see that lumen uses around half of the import time.

image

Yeah, the dask import should be lazy.

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.