mars-project / mars

Mars is a tensor-based unified framework for large-scale data computation which scales numpy, pandas, scikit-learn and Python functions.
https://mars-project.readthedocs.io
Apache License 2.0
2.7k stars 325 forks source link

[BUG] Support for higher versions of python #3315

Closed dashanji closed 1 year ago

dashanji commented 1 year ago

Describe the bug In higher versions of python (python 3.8.14+), I found that mars does not work as expected.

To Reproduce To help us reproducing this bug, please provide information below:

  1. Your Python version (3.8.14+)
  2. The version of Mars you use (0.9.0)
  3. Versions of crucial packages, such as numpy, scipy and pandas
  4. Full stack of the error.
  5. Minimized code to reproduce the error.

Install pymars 0.9.0 in python 3.8.14:

$ docker run -it python:3.8 /bin/bash
root@2cf33aa8d215:/# pip3 install pymars
root@2cf33aa8d215:/# python3
Python 3.8.14 (default, Oct  5 2022, 15:43:08) 
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import mars.dataframe
/usr/local/lib/python3.8/site-packages/mars/tensor/__init__.py:381: FutureWarning: In the future `np.object` will be defined as the corresponding NumPy scalar.  (This may have returned Python scalars in past versions.
  from numpy import object, int, bool, float
/usr/local/lib/python3.8/site-packages/mars/tensor/__init__.py:381: FutureWarning: In the future `np.bool` will be defined as the corresponding NumPy scalar.  (This may have returned Python scalars in past versions.
  from numpy import object, int, bool, float
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.8/site-packages/mars/dataframe/__init__.py", line 39, in <module>
    from .datasource.date_range import date_range
  File "/usr/local/lib/python3.8/site-packages/mars/dataframe/datasource/date_range.py", line 303, in <module>
    closed=NoDefault.no_default,
  File "/usr/local/lib/python3.8/typing.py", line 759, in __getattr__
    return getattr(self.__origin__, attr)
AttributeError: '_SpecialForm' object has no attribute 'no_default'

Install pymars 0.9.0 in python 3.9.14:

$ docker run -it python:3.9 /bin/bash
root@2cf33aa8d215:/# pip3 install pymars
root@d6bbd3d171e9:/# python3
Python 3.9.14 (main, Sep 13 2022, 14:50:42) 
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import mars.dataframe
/usr/local/lib/python3.9/site-packages/mars/tensor/__init__.py:381: FutureWarning: In the future `np.object` will be defined as the corresponding NumPy scalar.  (This may have returned Python scalars in past versions.
  from numpy import object, int, bool, float
/usr/local/lib/python3.9/site-packages/mars/tensor/__init__.py:381: FutureWarning: In the future `np.bool` will be defined as the corresponding NumPy scalar.  (This may have returned Python scalars in past versions.
  from numpy import object, int, bool, float
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.9/site-packages/mars/dataframe/__init__.py", line 39, in <module>
    from .datasource.date_range import date_range
  File "/usr/local/lib/python3.9/site-packages/mars/dataframe/datasource/date_range.py", line 303, in <module>
    closed=NoDefault.no_default,
  File "/usr/local/lib/python3.9/typing.py", line 710, in __getattr__
    return getattr(self.__origin__, attr)
AttributeError: '_LiteralSpecialForm' object has no attribute 'no_default'

For the lower version of python(3.7), it can work as expected.

$ docker run -it python:3.7 /bin/bash
root@2cf33aa8d215:/# pip3 install pymars
root@f8d6ffd9cbff:/# python3
Python 3.7.13 (default, May 28 2022, 14:49:57) 
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import mars.dataframe
>>> 

Expected behavior Support for higher versions of python.

Additional context Add any other context about the problem here.

qinxuye commented 1 year ago

The upcoming release will address this issue.

dashanji commented 1 year ago

Thanks

qinxuye commented 1 year ago

v0.10.0 has been released, you can try to update Mars to the newest version, I will close this issue first, feel free to reopen if you encounter any issue.