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 ibis-framework version 3 #5292

Merged
merged 3 commits into from
May 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 0 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ jobs:
conda activate test-environment
conda list
doit develop_install ${{ env.HV_REQUIREMENTS }}
conda install $CHANS_DEV "ibis-sqlite=2"
python -c "from param import version; print(version.Version.setup_version('.', 'holoviews', archive_commit='$Format:%h$'))"
echo "-----"
git describe
Expand Down
16 changes: 15 additions & 1 deletion holoviews/core/data/ibis.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import sys
import numpy
from packaging.version import Version

try:
from collections.abc import Iterable
Expand All @@ -14,6 +15,13 @@
from .util import cached


try:
import ibis
ibis_version = Version(ibis.__version__)
except ImportError:
pass


class IbisInterface(Interface):

types = ()
Expand Down Expand Up @@ -125,9 +133,15 @@ def values(
):
dimension = dataset.get_dimension(dimension, strict=True)
data = dataset.data[dimension.name]
if (
ibis_version > Version("3")
and isinstance(data, ibis.expr.types.AnyColumn)
and not expanded
):
data = dataset.data[[dimension.name]]
if not expanded:
data = data.distinct()
return data if keep_index or not compute else data.execute().values
return data if keep_index or not compute else data.execute().values.flatten()

@classmethod
def histogram(cls, expr, bins, density=True, weights=None):
Expand Down
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@

extras_require["unit_tests"] = extras_require["examples"] + extras_require["tests"]

if sys.version_info >= (3, 7):
extras_require["unit_tests"].append("ibis-sqlite")

extras_require["basic_tests"] = (
extras_require["tests"]
+ ["matplotlib >=3", "bokeh >=2.4.3", "pandas"]
Expand Down