Thanks to visit codestin.com
Credit goes to github.com

Skip to content
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
Next Next commit
fix ibis
  • Loading branch information
Marc Skov Madsen committed Nov 26, 2022
commit b7a75b20c09df6fc5e3352837b66580e97830ab1
2 changes: 1 addition & 1 deletion hvplot/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ def _process_data(self, kind, data, x, y, by, groupby, row, col,
'e.g. a NumPy array or xarray Dataset, '
'found %s type' % (kind, type(self.data).__name__))

if hasattr(data, 'columns') and data.columns.name and not group_label:
if hasattr(data, 'columns') and hasattr(data.columns, 'name') and data.columns.name and not group_label:
group_label = data.columns.name
elif not group_label:
group_label = 'Variable'
Expand Down
4 changes: 2 additions & 2 deletions hvplot/ibis.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ def patch(name='hvplot', extension='bokeh', logo=False):
try:
import ibis
except:
raise ImportError('Could not patch plotting API onto dask. '
'Dask could not be imported.')
raise ImportError('Could not patch plotting API onto ibis. '
'Ibis could not be imported.')
_patch_plot = lambda self: hvPlotTabular(self)
_patch_plot.__doc__ = hvPlotTabular.__call__.__doc__
patch_property = property(_patch_plot)
Expand Down
22 changes: 22 additions & 0 deletions hvplot/tests/testibis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"""Ibis works with hvplot"""
import pytest

try:
import ibis
import hvplot.ibis # noqa
import pandas as pd
except:
pytest.skip(reason='Ibis test dependencies not available', allow_module_level=True)


@pytest.fixture
def table():
df = pd.DataFrame({
"x": [pd.Timestamp("2022-01-01"), pd.Timestamp("2022-01-02")], "y": [1,2]
})
con = ibis.pandas.connect({"df": df})
return con.table("df")

def test_can_hvplot(table):
"""hvplot works with Ibis"""
table.hvplot(x="x", y="y")