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

[SPARK-34887][PYTHON] Port Koalas dependencies into PySpark #32386

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 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
10 changes: 10 additions & 0 deletions dev/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,13 @@ pydata_sphinx_theme
ipython
nbsphinx
numpydoc

# dependencies in pandas-on-spark.
Copy link
Contributor

Choose a reason for hiding this comment

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

@xinrong-databricks
Do you intend to include dev dependencies in this PR?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, this file is only used when setting up a dev env for now.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, this PR includes dev dependencies.

pandas>=0.23.2
pyarrow>=0.10
numpy>=1.14,<1.20.0

# Optional dependencies in pandas-on-spark.
mlflow>=1.0
plotly>=4.8
matplotlib>=3.0.0,<3.3.0
Copy link
Member

Choose a reason for hiding this comment

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

What is this file used for?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it's used for setting up a development environment for PySpark.

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure we should add them here because even dependencies for SQL or ML modules are not here.

Copy link
Member

Choose a reason for hiding this comment

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

this file is not used anywhere .. it's just for dev setup :-).

19 changes: 17 additions & 2 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,13 @@ def run(self):
'pyspark.bin',
'pyspark.sbin',
'pyspark.jars',
'pyspark.pandas',
'pyspark.pandas.indexes',
'pyspark.pandas.missing',
'pyspark.pandas.plot',
'pyspark.pandas.spark',
'pyspark.pandas.typedef',
'pyspark.pandas.usage_logging',
'pyspark.python.pyspark',
'pyspark.python.lib',
'pyspark.data',
Expand Down Expand Up @@ -250,14 +257,22 @@ def run(self):
license='http://www.apache.org/licenses/LICENSE-2.0',
# Don't forget to update python/docs/source/getting_started/install.rst
# if you're updating the versions or dependencies.
install_requires=['py4j==0.10.9.2'],
install_requires=[
'py4j==0.10.9.2',
'pandas>=0.23.2',
'pyarrow>=0.10',
'numpy>=1.14,<1.20.0',
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we should install them by default but should be extras.

Copy link
Member Author

Choose a reason for hiding this comment

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

They are moved to extras_require.

Does it mean when users install pyspark, pandas_on_spark doesn't work by default?

],
extras_require={
'ml': ['numpy>=1.7'],
'mllib': ['numpy>=1.7'],
'sql': [
'pandas>=%s' % _minimum_pandas_version,
'pyarrow>=%s' % _minimum_pyarrow_version,
Copy link
Member

Choose a reason for hiding this comment

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

nit: pyarrow minimun version is introduced in _minimum_pyarrow_version, but if we introduce the pyarrow>=0.10 for pandas_on_spark in here, maybe we could change the _minimum_pyarrow_version to something like _minimum_sql_pyarrow_version

[1] https://github.com/apache/spark/pull/32386/files#diff-eb8b42d9346d0a5d371facf21a8bfa2d16fb49e213ae7c21f03863accebe0fcfR115

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch! There is only one usage of _minimum_pyarrow_version. How about removing the variable and using the value instead?

Copy link
Member

Choose a reason for hiding this comment

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

If we can use the same lower bound, I prefer just use _minimum_pyarrow_version directly as suggestion in #32386 (comment)

'pandas_on_spark': [
    'pandas>=%s' % _minimum_pandas_version,
    'pyarrow>=%s', % _minimum_pyarrow_version,
]

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds good.

]
],
'pandas.mlflow': ['mlflow>=1.0'],
'pandas.plotly': ['plotly>=4.8'],
'pandas.matplotlib': ['matplotlib>=3.0.0,<3.3.0'],
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure we should list these here? cc @HyukjinKwon

Copy link
Member

Choose a reason for hiding this comment

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

Maybe we could:

extras_require={
    ...
    'pandas_on_spark':  [
        'pandas>=0.23.2',
        'pyarrow>=0.10',
        'numpy>=1.14,<1.20.0',
    ]
    ...

Yeah, I think we should remove them for now.

Copy link
Member

Choose a reason for hiding this comment

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

We might need to add some description in [1] to add the dependencies info for pandas_on_spark.
[1] https://spark.apache.org/docs/latest/api/python/getting_started/install.html#dependencies

Copy link
Member Author

Choose a reason for hiding this comment

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

Optional dependencies for pandas-on-spark have been removed.
Dependencies for pandas-on-spark have been moved to extras_require.

Copy link
Member Author

Choose a reason for hiding this comment

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

Descriptions are added to install.rst.

Shall we call it Pandas-on-spark in the document?

},
python_requires='>=3.6',
classifiers=[
Expand Down