| 1 |
from __future__ import annotations |
| 2 |
|
| 3 |
try: |
| 4 |
from dask.widgets.widgets import ( |
| 5 |
FILTERS, |
| 6 |
TEMPLATE_PATHS, |
| 7 |
get_environment, |
| 8 |
get_template, |
| 9 |
) |
| 10 |
|
| 11 |
except ImportError as e: |
| 12 |
msg = ( |
| 13 |
"Dask diagnostics requirements are not installed.\n\n" |
| 14 |
"Please either conda or pip install as follows:\n\n" |
| 15 |
" conda install dask # either conda install\n" |
| 16 |
' python -m pip install "dask[diagnostics]" --upgrade # or python -m pip install' |
| 17 |
) |
| 18 |
exception = e # Explicit reference for e as it will be lost outside the try block |
| 19 |
FILTERS = {} |
| 20 |
TEMPLATE_PATHS = [] |
| 21 |
|
| 22 |
def get_environment(): |
| 23 |
raise ImportError(msg) from exception |
| 24 |
|
| 25 |
def get_template(name: str): |
| 26 |
raise ImportError(msg) from exception |