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

Improve typing experience of users of the hvplot namespace #1486

Open
maximlt opened this issue Feb 4, 2025 · 0 comments
Open

Improve typing experience of users of the hvplot namespace #1486

maximlt opened this issue Feb 4, 2025 · 0 comments
Labels

Comments

@maximlt
Copy link
Member

maximlt commented Feb 4, 2025

The .hvplot namespace is dynamically mounted on the data type of the imported source. For example, importing hvplot.pandas dynamically adds the hvplot property to pd.DataFrame. This dynamic approach makes it totally invisible to type checkers, typing df.hvplot in VS Code for instance gives no hint to the user. Given how important typing has become in Python, that's pretty bad! Note that the situation is much better when the code is executed in an IPython context.

I don't know if there's a way to fix that just using Python typing? If there's none, we should find and document a way for users to get a better typing experience using hvPlot. For example, this is already much better:

from hvplot import hvPlotTabular

plot = hvPlotTabular(data).line()
Image

Note: It's probably best to recommend importing and using hvPlot instead of hvPlotTabular.

Related to #893

@maximlt maximlt added type: discussion type: enhancement New feature or request labels Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant