hvplot icon indicating copy to clipboard operation
hvplot copied to clipboard

Ensure hvplot.<ext> hooks are run on every import

Open philippjfr opened this issue 1 year ago • 1 comments

The hvplot.<ext> import mechanism is a convenient way to allow users to have to avoid running the holoviews/panel extensions. However since imports are cached only the first import actually embeds the extension JS code, meaning that if you re-run the cell(s) containing import hvplot.pandas (or some other integration) then the JS will no longer be available and on subsequent reloads/re-runs of the notebook plots may not appear. This probably accounts for most issues encountered and described in https://github.com/holoviz/hvplot/issues/1232.

Here we add an IPython hook which simply deletes the modules before every cell execution. This is a big hammer but the best @hoxbro and I could find and at least it is restricted to IPython environments.

philippjfr avatar Jun 20 '24 10:06 philippjfr

We need to update the logic to only register hvplot extensions once, have updated it for some but we should update it for all.

 Screenshot 2024-06-20 14 44 48

hoxbro avatar Jun 20 '24 12:06 hoxbro

We need to look more into how this is going to affect Polars' users.

maximlt avatar Jul 16 '24 14:07 maximlt

@hoxbro can you please review?

maximlt avatar Sep 13 '24 10:09 maximlt

Codecov Report

Attention: Patch coverage is 73.95833% with 25 lines in your changes missing coverage. Please review.

Project coverage is 88.73%. Comparing base (6c96c7e) to head (763392d). Report is 24 commits behind head on main.

Files with missing lines Patch % Lines
hvplot/cudf.py 0.00% 13 Missing :warning:
hvplot/intake.py 0.00% 7 Missing :warning:
hvplot/__init__.py 64.28% 5 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1359      +/-   ##
==========================================
+ Coverage   87.39%   88.73%   +1.34%     
==========================================
  Files          50       51       +1     
  Lines        7490     7592     +102     
==========================================
+ Hits         6546     6737     +191     
+ Misses        944      855      -89     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Sep 13 '24 10:09 codecov[bot]

oh my word, this explains so much, thanks for hunting it down...

michaelaye avatar Sep 25 '24 11:09 michaelaye