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

Ensure that repr is initialized on hvplot backend import #774

Merged
merged 2 commits into from
Jul 27, 2022

Conversation

philippjfr
Copy link
Member

Previously if the panel extension had been loaded this post_patch hook would not call hv.extension which meant that the reprs required for rendering HoloViews components were not registered. I'm not entirely sure how this ever worked but now that we avoid repeat cell execution it is perfectly fine to call hv.extension multiple times.

Fixes #773

@maximlt maximlt added this to the 0.8.1 milestone Jul 18, 2022
@maximlt
Copy link
Member

maximlt commented Jul 24, 2022

Just to be sure, what we don't and maybe can't cover is the case where e.g. a user loads hv.extension('bokeh'), then somehow manages to get rid of the loaded Javascript/CSS by deleting the cell and reloading the browser tab, then imports hvplot.pandas. In that case the remaining optimization if will still identify the extension as loaded so the loading of the Javascript/CSS won't happen again and will still be missing, any later call to df.hvplot() will not display anything.

This differs from the behavior of hv.extension(). I.e. runninghv.extension('bokeh') in different cells will load the Javascript/CSS everytime, while running import hvplot.pandas in different cells will only load in the first cell.

I just want to make sure we're clear about the behavior we want to get when executing theses statements in different cells. In a single cell context it's clear from the update made to pyviz_comms that the intention was to only make one Javascript/CSS load whatever the number of statements that would have this side effect.

@philippjfr
Copy link
Member Author

That's right, we explicitly tell users that an extension load is needed so users that delete the cell with the loaded extension can't expect things to work.

@maximlt maximlt merged commit a40c21f into master Jul 27, 2022
@maximlt maximlt deleted the extension_load_fix branch July 27, 2022 15:54
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.

Extension not loaded when importing hvplot.pandas after running panel.extension()
2 participants