xorbitsai / xorbits

Scalable Python DS & ML, in an API compatible & lightning fast way.
https://xorbits.readthedocs.io
Apache License 2.0
1.11k stars 67 forks source link

BUG: build_mock_groupby raises TypeError: 'int' object is not iterable #637

Closed codingl2k1 closed 1 year ago

codingl2k1 commented 1 year ago

Describe the bug

A clear and concise description of what the bug is.

To Reproduce

To help us to reproduce this bug, please provide information below:

>>> pdf.groupby("max_stars_repo_licenses")["max_issues_count"]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ubuntu/xorbits/python/xorbits/core/adapter.py", line 294, in wrapped
    return wrap_mars_callable(
  File "/home/ubuntu/xorbits/python/xorbits/core/adapter.py", line 472, in wrapped
    return from_mars(c(*to_mars(args), **to_mars(kwargs)))
  File "/home/ubuntu/xorbits/python/xorbits/_mars/dataframe/groupby/getitem.py", line 138, in df_groupby_getitem
    return op(df_groupby)
  File "/home/ubuntu/xorbits/python/xorbits/_mars/core/mode.py", line 78, in _inner
    return func(*args, **kwargs)
  File "/home/ubuntu/xorbits/python/xorbits/_mars/dataframe/groupby/getitem.py", line 49, in __call__
    indexed = groupby.op.build_mock_groupby()[self.selection]
  File "/home/ubuntu/xorbits/python/xorbits/_mars/dataframe/groupby/core.py", line 149, in build_mock_groupby
    mock_obj = build_df(
  File "/home/ubuntu/xorbits/python/xorbits/_mars/dataframe/utils.py", line 650, in build_df
    record = [[_generate_value(dtype, fill_value) for dtype in dtypes]] * size
  File "/home/ubuntu/xorbits/python/xorbits/_mars/dataframe/utils.py", line 650, in <listcomp>
    record = [[_generate_value(dtype, fill_value) for dtype in dtypes]] * size
  File "/home/ubuntu/xorbits/python/xorbits/_mars/dataframe/utils.py", line 613, in _generate_value
    return convert(fill_value)
TypeError: 'int' object is not iterable
  1. Your Python version
  2. The version of Xorbits you use
  3. Versions of crucial packages, such as numpy, scipy and pandas
  4. Full stack of the error.
  5. Minimized code to reproduce the error.

Expected behavior

A clear and concise description of what you expected to happen.

Additional context

Add any other context about the problem here.