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

fix(docs): fix dask in support matrix #110

Merged
merged 1 commit into from
May 30, 2024

Conversation

jitingxu1
Copy link
Collaborator

@jitingxu1 jitingxu1 commented May 29, 2024

Dask had an issue of this TypeError: descriptor '__call__' for 'type' objects doesn't apply to a 'property' object for lower version. The support of dask is not calculated because the dask error.

image

I update dask to its latest version, it solves the problem.

Check with dask/dask#11035 for details.

Rendered webpage: https://jitingxu1.github.io/ibis-ml/support_matrix.html

image

@jitingxu1 jitingxu1 marked this pull request as draft May 29, 2024 17:58
@codecov-commenter
Copy link

codecov-commenter commented May 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.53%. Comparing base (0421c66) to head (717783a).
Report is 18 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #110   +/-   ##
=======================================
  Coverage   84.53%   84.53%           
=======================================
  Files          24       24           
  Lines        1862     1862           
=======================================
  Hits         1574     1574           
  Misses        288      288           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jitingxu1 jitingxu1 marked this pull request as ready for review May 29, 2024 19:16
@jitingxu1 jitingxu1 requested a review from deepyaman May 29, 2024 19:17
pyproject.toml Outdated
@@ -16,7 +16,8 @@ dynamic = ["version", "description"]
dask = ["dask[dataframe]"]
doc = [
"clickhouse-connect",
"ibis-framework[bigquery,clickhouse,dask,datafusion,duckdb,druid,examples,exasol,flink,impala,mssql,mysql,oracle,polars,postgres,pyspark,risingwave,snowflake,sqlite,trino]",
"dask",
Copy link
Collaborator

@deepyaman deepyaman May 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this will break the backend, right? As per ibis-project/ibis#8628 Even if execution and stuff works, it's not correct.

Is there perhaps an older version of Dask that would work?

Edit: Also, dask/dask#11035 mentions that the issue is just on 3.11.9; is that true? Can this be avoided in the docs by avoiding this Python version, maybe just stick with 3.11.8 or use 3.12? It seems the CI uses 3.12; is this the right issue then?

Copy link
Collaborator Author

@jitingxu1 jitingxu1 May 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think they fixed the issue for 3.11.9, still see the problem for 3.12.

I tried older version of dask, it does not work.

Here is the way to reproduce the error:

# dask Version: 2024.2.0
# Python version: 3.12.3 
# ibis version  10.0.0.dev100

import ibis
backend = "dask"
con = ibis.connect(f"{backend}://")

error

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[7], line 1
----> 1 con = ibis.connect(f"{backend}://")

File ~/miniconda3/envs/ibisml-dev/lib/python3.12/site-packages/ibis/backends/__init__.py:1401, in connect(resource, **kwargs)
   1398     url = url.replace(":", "://", 1)
   1400 try:
-> 1401     backend = getattr(ibis, scheme)
   1402 except AttributeError:
   1403     raise ValueError(f"Don't know how to connect to {resource!r}") from None

File ~/miniconda3/envs/ibisml-dev/lib/python3.12/site-packages/ibis/__init__.py:78, in __getattr__(name)
     76 (entry_point,) = entry_points
     77 try:
---> 78     module = entry_point.load()
     79 except ImportError as exc:
     80     raise ImportError(
     81         f"Failed to import the {name} backend due to missing dependencies.\n\n"
     82         f"You can pip or conda install the {name} backend as follows:\n\n"
     83         f'  python -m pip install -U "ibis-framework[{name}]"  # pip install\n'
     84         f"  conda install -c conda-forge ibis-{name}           # or conda install"
     85     ) from exc

File ~/miniconda3/envs/ibisml-dev/lib/python3.12/site-packages/importlib_metadata/__init__.py:184, in EntryPoint.load(self)
    179 """Load the entry point from its definition. If only a module
    180 is indicated by the value, return that module. Otherwise,
    181 return the named object.
    182 """
    183 match = cast(Match, self.pattern.match(self.value))
--> 184 module = import_module(match.group('module'))
    185 attrs = filter(None, (match.group('attr') or '').split('.'))
    186 return functools.reduce(getattr, attrs, module)

File ~/miniconda3/envs/ibisml-dev/lib/python3.12/importlib/__init__.py:90, in import_module(name, package)
     88             break
     89         level += 1
---> 90 return _bootstrap._gcd_import(name[level:], package, level)

File <frozen importlib._bootstrap>:1387, in _gcd_import(name, package, level)

File <frozen importlib._bootstrap>:1360, in _find_and_load(name, import_)

File <frozen importlib._bootstrap>:1331, in _find_and_load_unlocked(name, import_)

File <frozen importlib._bootstrap>:935, in _load_unlocked(spec)

File <frozen importlib._bootstrap_external>:995, in exec_module(self, module)

File <frozen importlib._bootstrap>:488, in _call_with_frames_removed(f, *args, **kwds)

File ~/miniconda3/envs/ibisml-dev/lib/python3.12/site-packages/ibis/backends/dask/__init__.py:6
      3 from typing import TYPE_CHECKING, Any
      5 import dask
----> 6 import dask.dataframe as dd
      7 import pandas as pd
      9 import ibis.common.exceptions as com

File ~/miniconda3/envs/ibisml-dev/lib/python3.12/site-packages/dask/dataframe/__init__.py:100
     98 import dask.dataframe._pyarrow_compat
     99 from dask.base import compute
--> 100 from dask.dataframe import backends, dispatch, rolling
    101 from dask.dataframe.core import (
    102     DataFrame,
    103     Index,
   (...)
    109     to_timedelta,
    110 )
    111 from dask.dataframe.groupby import Aggregation

File ~/miniconda3/envs/ibisml-dev/lib/python3.12/site-packages/dask/dataframe/backends.py:15
     13 from dask.backends import CreationDispatch, DaskBackendEntrypoint
     14 from dask.dataframe._compat import PANDAS_GE_220, is_any_real_numeric_dtype
---> 15 from dask.dataframe.core import DataFrame, Index, Scalar, Series, _Frame
     16 from dask.dataframe.dispatch import (
     17     categorical_dtype_dispatch,
     18     concat,
   (...)
     35     union_categoricals_dispatch,
     36 )
     37 from dask.dataframe.extensions import make_array_nonempty, make_scalar

File ~/miniconda3/envs/ibisml-dev/lib/python3.12/site-packages/dask/dataframe/core.py:36
     34 from dask.blockwise import Blockwise, BlockwiseDep, BlockwiseDepDict, blockwise
     35 from dask.context import globalmethod
---> 36 from dask.dataframe import methods
     37 from dask.dataframe._compat import (
     38     PANDAS_GE_140,
     39     PANDAS_GE_150,
   (...)
     47     is_string_dtype,
     48 )
     49 from dask.dataframe.accessor import CachedAccessor, DatetimeAccessor, StringAccessor

File ~/miniconda3/envs/ibisml-dev/lib/python3.12/site-packages/dask/dataframe/methods.py:34
     22 #  preserve compatibility while moving dispatch objects
     23 from dask.dataframe.dispatch import (  # noqa: F401
     24     concat,
     25     concat_dispatch,
   (...)
     32     union_categoricals,
     33 )
---> 34 from dask.dataframe.utils import is_dataframe_like, is_index_like, is_series_like
     35 from dask.utils import _deprecated_kwarg
     37 # cuDF may try to import old dispatch functions

File ~/miniconda3/envs/ibisml-dev/lib/python3.12/site-packages/dask/dataframe/utils.py:20
     18 from dask.base import get_scheduler, is_dask_collection
     19 from dask.core import get_deps
---> 20 from dask.dataframe import (  # noqa: F401 register pandas extension types
     21     _dtypes,
     22     methods,
     23 )
     24 from dask.dataframe._compat import PANDAS_GE_150, tm  # noqa: F401
     25 from dask.dataframe.dispatch import (  # noqa : F401
     26     make_meta,
     27     make_meta_obj,
     28     meta_nonempty,
     29 )

File ~/miniconda3/envs/ibisml-dev/lib/python3.12/site-packages/dask/dataframe/_dtypes.py:9
      6 import pandas as pd
      8 from dask.dataframe._compat import PANDAS_GE_150
----> 9 from dask.dataframe.extensions import make_array_nonempty, make_scalar
     12 @make_array_nonempty.register(pd.DatetimeTZDtype)
     13 def _(dtype):
     14     return pd.array([pd.Timestamp(1), pd.NaT], dtype=dtype)

File ~/miniconda3/envs/ibisml-dev/lib/python3.12/site-packages/dask/dataframe/extensions.py:8
      1 """
      2 Support for pandas ExtensionArray in dask.dataframe.
      3 
      4 See :ref:`extensionarrays` for more.
      5 """
      6 from __future__ import annotations
----> 8 from dask.dataframe.accessor import (
      9     register_dataframe_accessor,
     10     register_index_accessor,
     11     register_series_accessor,
     12 )
     13 from dask.utils import Dispatch
     15 make_array_nonempty = Dispatch("make_array_nonempty")

File ~/miniconda3/envs/ibisml-dev/lib/python3.12/site-packages/dask/dataframe/accessor.py:126
    113         token = f"{self._accessor_name}-{attr}"
    114         return self._series.map_partitions(
    115             self._delegate_method,
    116             self._accessor_name,
   (...)
    122             token=token,
    123         )
--> 126 class DatetimeAccessor(Accessor):
    127     """Accessor object for datetimelike properties of the Series values.
    128 
    129     Examples
   (...)
    132     >>> s.dt.microsecond  # doctest: +SKIP
    133     """
    135     _accessor_name = "dt"

File ~/miniconda3/envs/ibisml-dev/lib/python3.12/site-packages/dask/dataframe/accessor.py:81, in Accessor.__init_subclass__(cls, **kwargs)
     79 attr, min_version = item if isinstance(item, tuple) else (item, None)
     80 if not hasattr(cls, attr):
---> 81     _bind_property(cls, pd_cls, attr, min_version)

File ~/miniconda3/envs/ibisml-dev/lib/python3.12/site-packages/dask/dataframe/accessor.py:35, in _bind_property(cls, pd_cls, attr, min_version)
     33 except Exception:
     34     pass
---> 35 setattr(cls, attr, property(derived_from(pd_cls, version=min_version)(func)))

File ~/miniconda3/envs/ibisml-dev/lib/python3.12/site-packages/dask/utils.py:987, in derived_from.<locals>.wrapper(method)
    985 try:
    986     extra = getattr(method, "__doc__", None) or ""
--> 987     method.__doc__ = _derived_from(
    988         original_klass,
    989         method,
    990         ua_args=ua_args,
    991         extra=extra,
    992         skipblocks=skipblocks,
    993         inconsistencies=inconsistencies,
    994     )
    995     return method
    997 except AttributeError:

File ~/miniconda3/envs/ibisml-dev/lib/python3.12/site-packages/dask/utils.py:940, in _derived_from(cls, method, ua_args, extra, skipblocks, inconsistencies)
    938 # Mark unsupported arguments
    939 try:
--> 940     method_args = get_named_args(method)
    941     original_args = get_named_args(original_method)
    942     not_supported = [m for m in original_args if m not in method_args]

File ~/miniconda3/envs/ibisml-dev/lib/python3.12/site-packages/dask/utils.py:701, in get_named_args(func)
    699 def get_named_args(func) -> list[str]:
    700     """Get all non ``*args/**kwargs`` arguments for a function"""
--> 701     s = inspect.signature(func)
    702     return [
    703         n
    704         for n, p in s.parameters.items()
    705         if p.kind in [p.POSITIONAL_OR_KEYWORD, p.POSITIONAL_ONLY, p.KEYWORD_ONLY]
    706     ]

File ~/miniconda3/envs/ibisml-dev/lib/python3.12/inspect.py:3310, in signature(obj, follow_wrapped, globals, locals, eval_str)
   3308 def signature(obj, *, follow_wrapped=True, globals=None, locals=None, eval_str=False):
   3309     """Get a signature object for the passed callable."""
-> 3310     return Signature.from_callable(obj, follow_wrapped=follow_wrapped,
   3311                                    globals=globals, locals=locals, eval_str=eval_str)

File ~/miniconda3/envs/ibisml-dev/lib/python3.12/inspect.py:3054, in Signature.from_callable(cls, obj, follow_wrapped, globals, locals, eval_str)
   3050 @classmethod
   3051 def from_callable(cls, obj, *,
   3052                   follow_wrapped=True, globals=None, locals=None, eval_str=False):
   3053     """Constructs Signature for the given callable object."""
-> 3054     return _signature_from_callable(obj, sigcls=cls,
   3055                                     follow_wrapper_chains=follow_wrapped,
   3056                                     globals=globals, locals=locals, eval_str=eval_str)

File ~/miniconda3/envs/ibisml-dev/lib/python3.12/inspect.py:2642, in _signature_from_callable(obj, follow_wrapper_chains, skip_bound_arg, globals, locals, eval_str, sigcls)
   2640     call = getattr_static(type(obj), '__call__', None)
   2641     if call is not None:
-> 2642         call = _descriptor_get(call, obj)
   2643         return _get_signature_of(call)
   2645 raise ValueError('callable {!r} is not supported by signature'.format(obj))

File ~/miniconda3/envs/ibisml-dev/lib/python3.12/inspect.py:2467, in _descriptor_get(descriptor, obj)
   2465 if get is _sentinel:
   2466     return descriptor
-> 2467 return get(descriptor, obj, type(obj))

TypeError: descriptor '__call__' for 'type' objects doesn't apply to a 'property' object```

Copy link
Collaborator

@deepyaman deepyaman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a comment/explanation, but makes sense to me

@deepyaman deepyaman merged commit ec64121 into ibis-project:main May 30, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants