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

support polars in hvplot.plot method #1219

Merged
merged 2 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion hvplot/plotting/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import holoviews as hv
from ..util import with_hv_extension
from ..util import with_hv_extension, is_polars

from .core import hvPlot, hvPlotTabular # noqa

Expand Down Expand Up @@ -30,6 +30,9 @@ def plot(data, kind, **kwargs):
if v is not None:
no_none_kwargs[k] = v

if is_polars(data):
from hvplot.polars import hvPlotTabularPolars
return hvPlotTabularPolars(data)(kind=kind, **no_none_kwargs)
return hvPlotTabular(data)(kind=kind, **no_none_kwargs)


Expand Down
6 changes: 6 additions & 0 deletions hvplot/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,12 @@ def is_dask(data):
import dask.dataframe as dd
return isinstance(data, (dd.DataFrame, dd.Series))

def is_polars(data):
if not check_library(data, 'polars'):
return False
import polars as pl
return isinstance(data, (pl.DataFrame, pl.Series))
MarcoGorelli marked this conversation as resolved.
Show resolved Hide resolved

def is_intake(data):
if "intake" not in sys.modules:
return False
Expand Down