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-32180][PYTHON][DOCS] Installation page of Getting Started in PySpark documentation #29640

Conversation

rohitmishr1484
Copy link

@rohitmishr1484 rohitmishr1484 commented Sep 3, 2020

What changes were proposed in this pull request?

This PR proposes to add getting started- installation to new PySpark docs.

Why are the changes needed?

Better documentation.

Does this PR introduce any user-facing change?

No. Documentation only.

How was this patch tested?

Generating documents locally.

@rohitmishr1484
Copy link
Author

rohitmishr1484 commented Sep 3, 2020

Hi @HyukjinKwon,

As per your suggestion, I have made the necessary changes. Please have a look at it.

  • This is a new pull request on the same topic (installation page), as you rightly pointed the earlier got messed up. Thanks for pointing that out. I am pretty sure it's a mistake from my end since I tried updating a forked repo for the first time. I am attaching a pdf copy of my earlier pull request since it contains all your earlier review and comments (see last few pages of the pdf)

PR.pdf

Please let me know your thoughts and apologize for making you review this document multiple times.

@HyukjinKwon
Copy link
Member

ok to test

@SparkQA
Copy link

SparkQA commented Sep 4, 2020

Test build #128271 has finished for PR 29640 at commit d32ece1.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@HyukjinKwon
Copy link
Member

Looks fine otherwise. @holdenk and @srowen can you take a look when you guys are available?

Installation
============

The official release channel is to download it from `the Apache Spark website <https://spark.apache.org/downloads.html>`_.
Copy link
Member

Choose a reason for hiding this comment

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

"Official releases are available from ..."


conda activate pyspark_env

In lower Conda version, the following command might be used:
Copy link
Member

Choose a reason for hiding this comment

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

In earlier Conda versions ... should be used:
(earlier than what?)

Copy link
Author

Choose a reason for hiding this comment

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

Hi @srowen,

Based on the conda documentation the answer is "Conda version before 4.4".
The Source for this info is

conda activate: The logic and mechanisms underlying environment activation have been reworked. With conda 4.4, conda activate and conda deactivate are now the preferred commands for activating and deactivating environments. You'll find they are much more snappy than the source activate and source deactivate commands from previous conda versions. The conda activate command also has advantages of (1) being universal across all OSes, shells, and platforms, and (2) not having path collisions with scripts from other packages like Python virtualenv's activate script.

Copy link
Member

Choose a reason for hiding this comment

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

Right, I'm suggesting saying that here.

@rohitmishr1484
Copy link
Author

rohitmishr1484 commented Sep 5, 2020

@HyukjinKwon and @srowen, Thanks for your review.

@HyukjinKwon, I have updated all the changes you suggested.
@srowen, I have added comments corresponding to the 3 questions you had and updated other suggested changes.

I have summited a commit with some of the changes.

I will update other changes (corresponding to the comments) once both of you give a green signal.

@SparkQA
Copy link

SparkQA commented Sep 5, 2020

Test build #128318 has finished for PR 29640 at commit 45ce72e.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

Using Conda
-----------

Conda is an open-source package management and environment management system which is a part of `Anaconda <https://docs.continuum.io/anaconda/>`_ distribution. It is both cross-platform and language agnostic.
Copy link
Member

Choose a reason for hiding this comment

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

part of the


conda activate pyspark_env

In Conda version earlier than 4.4, the following command might be used:
Copy link
Member

Choose a reason for hiding this comment

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

should be used


source activate pyspark_env

PySpark installation using ``pip`` under Conda environment is official.
Copy link
Member

Choose a reason for hiding this comment

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

What do you mean 'official' here?


pip install pyspark

`PySpark at Conda <https://anaconda.org/conda-forge/pyspark>`_ is not the official release.
Copy link
Member

Choose a reason for hiding this comment

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

Same, I don't think this matters

Copy link
Member

Choose a reason for hiding this comment

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

I would just say, for example:

Note that PySpark at Conda <https://anaconda.org/conda-forge/pyspark>_ is available but not necessarily synced with PySpark release cycle because it is maintained by the community separately.


Ensure the ``SPARK_HOME`` environment variable points to the directory where the code has been extracted.
Define ``PYTHONPATH`` such that it can find the PySpark and
Py4J under ``$SPARK_HOME/python/lib``, one example of doing this is shown below:
Copy link
Member

Choose a reason for hiding this comment

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

(By the way I think you need just single back-ticks?)
Start a new sentence at "One example"

Copy link
Member

Choose a reason for hiding this comment

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

oh fyi double backticks here make it like a code block. single backtick makes italic for some reasons.

`Py4J` 0.10.9 Required
============= ========================= ==========================================================================

**Note**: A prerequisite for PySpark installation is the availability of JAVA 8 or later and ``JAVA_HOME`` properly set.
Copy link
Member

Choose a reason for hiding this comment

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

JAVA -> Java
Nit: you can avoid a lot of these passive sentences. "PySpark requires Java 8 or later, with JAVA_HOME properly set" for example.

============= ========================= ==========================================================================

**Note**: A prerequisite for PySpark installation is the availability of JAVA 8 or later and ``JAVA_HOME`` properly set.
For using JDK 11, set ``-Dio.netty.tryReflectionSetAccessible=true`` for Arrow related features and refer to `Downloading <https://spark.apache.org/docs/latest/#downloading>`_
Copy link
Member

Choose a reason for hiding this comment

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

If using Java 11, set ...

============= ========================= ==========================================================================
`pandas` 0.23.2 Optional for SQL component
`NumPy` 1.7 Required for ML component(Optional in PySpark if ML component is not used)
`pyarrow` 0.15.1 Optional
Copy link
Member

Choose a reason for hiding this comment

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

pyarrow is also currently only Optional for SQL.

============= ========================= ==========================================================================
Package Minimum supported version Note
============= ========================= ==========================================================================
`pandas` 0.23.2 Optional for SQL component
Copy link
Member

Choose a reason for hiding this comment

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

I would just write like:

Optional for SQL
Required for ML
Optional for SQL

Seems too long. Sorry for a bit of forth and back here.

@SparkQA
Copy link

SparkQA commented Sep 9, 2020

Test build #128469 has finished for PR 29640 at commit 14a97f8.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@rohitmishr1484
Copy link
Author

@HyukjinKwon and @srowen,

I have made the suggested changes. Thanks for your review.

@srowen
Copy link
Member

srowen commented Sep 11, 2020

Merged to master

@srowen srowen closed this in f6322d1 Sep 11, 2020
@sunchao
Copy link
Member

sunchao commented Sep 11, 2020

@srowen @rohitmishr1484 seems this commit is failing Python linter:

Warning, treated as error:
/home/runner/work/spark/spark/python/docs/source/getting_started/installation.rst:20:Duplicate explicit target name: "official release channel".
Makefile:20: recipe for target 'html' failed
make: *** [html] Error 2

@srowen
Copy link
Member

srowen commented Sep 12, 2020

Weird - it passed the test run above. Let me take a look and patch it.

ueshin pushed a commit that referenced this pull request Sep 12, 2020
This simply fixes an .rst generation error in #29640

Closes #29735 from srowen/SPARK-32180.2.

Authored-by: Sean Owen <srowen@gmail.com>
Signed-off-by: Takuya UESHIN <ueshin@databricks.com>
a0x8o added a commit to a0x8o/spark that referenced this pull request Sep 12, 2020
This simply fixes an .rst generation error in apache/spark#29640

Closes #29735 from srowen/SPARK-32180.2.

Authored-by: Sean Owen <srowen@gmail.com>
Signed-off-by: Takuya UESHIN <ueshin@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants