From 68f98da1358701e157caa6c5ef4d82cea7e42fdd Mon Sep 17 00:00:00 2001 From: Simon Hoxbro Date: Sun, 1 May 2022 13:55:31 +0200 Subject: [PATCH 1/3] Attempt to update ibis to 3.0 --- .github/workflows/test.yaml | 2 +- holoviews/core/data/ibis.py | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 925f465bf5..d1a768d33e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -58,7 +58,7 @@ jobs: conda activate test-environment conda list doit develop_install ${{ env.HV_REQUIREMENTS }} - conda install $CHANS_DEV "ibis-sqlite=2" + pip install ibis-framework python -c "from param import version; print(version.Version.setup_version('.', 'holoviews', archive_commit='$Format:%h$'))" echo "-----" git describe diff --git a/holoviews/core/data/ibis.py b/holoviews/core/data/ibis.py index 537c67be5a..6213b81e6d 100644 --- a/holoviews/core/data/ibis.py +++ b/holoviews/core/data/ibis.py @@ -1,5 +1,6 @@ import sys import numpy +from packaging.version import Version try: from collections.abc import Iterable @@ -14,6 +15,13 @@ from .util import cached +try: + import ibis + ibis_version = Version(ibis.__version__) +except ImportError: + pass + + class IbisInterface(Interface): types = () @@ -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): From b84a19ad1d1cfc7fdc4c05403116428655af9e0d Mon Sep 17 00:00:00 2001 From: Simon Hoxbro Date: Mon, 2 May 2022 19:35:39 +0200 Subject: [PATCH 2/3] Back to conda --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index d1a768d33e..2ce750e4ad 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -58,7 +58,7 @@ jobs: conda activate test-environment conda list doit develop_install ${{ env.HV_REQUIREMENTS }} - pip install ibis-framework + conda install $CHANS_DEV ibis-sqlite python -c "from param import version; print(version.Version.setup_version('.', 'holoviews', archive_commit='$Format:%h$'))" echo "-----" git describe From 1e195572ca2f63093c5ca6ba086988cb21af0ace Mon Sep 17 00:00:00 2001 From: Simon Hoxbro Date: Fri, 27 May 2022 11:59:16 +0200 Subject: [PATCH 3/3] Moved ibis-sqlite to setup.py --- .github/workflows/test.yaml | 1 - setup.py | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 2ce750e4ad..e50f36df48 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -58,7 +58,6 @@ jobs: conda activate test-environment conda list doit develop_install ${{ env.HV_REQUIREMENTS }} - conda install $CHANS_DEV ibis-sqlite python -c "from param import version; print(version.Version.setup_version('.', 'holoviews', archive_commit='$Format:%h$'))" echo "-----" git describe diff --git a/setup.py b/setup.py index b7c07bf141..78a8ec2208 100644 --- a/setup.py +++ b/setup.py @@ -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"]