Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat(python): add plot namespace (which defers to hvplot) #13238
feat(python): add plot namespace (which defers to hvplot) #13238
Changes from 17 commits
2619c8a
4805791
648c16f
fe8729d
4123a73
ff7aaa6
019bcb9
0506a16
cde1728
335c8c4
2d99d1a
af60d9a
28865de
c3ab5e6
e0af814
56612b3
0a4ae04
3696df4
ab84eb1
19aca75
30e4e01
bba5c5a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hoxbro @maximlt I've tried writing this so it doesn't register the namespace by default
Does this look right to you?
Can Polars trust that this API will remain stable? If not, is there anything else you'd suggest using instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In conjunction with holoviz/hvplot#1243 , I think this should ensure stability
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest using
hvplot.post_patch
which does not show the ugly internals.This will then (almost) mimic what we do with
import hvplot.polars
(other than registering thehvplot
accessor).i was thinking the same thing, but you beat me to it 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be required -
plot
is not an empty function so it's skipped. Everything runs fine when I comment this out - am I missing something?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you try building the docs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm no, indeed it fails on building the docs. But the problem isn't that
.plot
is not available on Expr. The problem is that it callshvPlotTabularPolars
which imports polars, which doesn't exist while building the docs.I'm not sure of the best solution here. I would ideally want to avoid hardcoding random stuff here as the functionality is already complex enough. But I'm not sure what the best solution would be 🤔
I think we should probably update
sphinx_accessor
in some way to avoid this from happening. Looking into it as we speak...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, but my understanding is that
expr_dispatch
is only needed for methods available onExpr
you're right about complexity, I just couldn't think of a solution which doesn't add any. maybe there's a more generic solution which would mean that this isn't necessary
cc @alexander-beedie in case you have ideas here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adding this to avoid an importerror if building the docs without
hvplot
installed. I don't thinkhvplot
should be required for building docs, and it's probably not worth showing plots in the docs themselves