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-44742][PYTHON][DOCS] Add Spark version drop down to the PySpark doc site #42428

Closed
wants to merge 9 commits into from

Conversation

panbingkun
Copy link
Contributor

What changes were proposed in this pull request?

The pr aims to add Spark version drop down to the PySpark doc site.

Why are the changes needed?

Currently, PySpark documentation does not have a version dropdown. While by default we want people to land on the latest version, it will be helpful and easier for people to find docs if we have this version dropdown.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Manual testing.

cd python/docs
make html

@panbingkun
Copy link
Contributor Author

After patch:
This is not a complete list. If this format is possible, I will add all version links.

image image

@gengliangwang
Copy link
Member

Add Spark version drop down to the PySpark doc site

This is more like a new page instead of "drop down"

@@ -24,7 +24,7 @@ PySpark Overview
**Date**: |today| **Version**: |release|

**Useful links**:
|binder|_ | `GitHub <https://github.com/apache/spark>`_ | `Issues <https://issues.apache.org/jira/projects/SPARK/issues>`_ | |examples|_ | `Community <https://spark.apache.org/community.html>`_
|binder|_ | `GitHub <https://github.com/apache/spark>`_ | `Issues <https://issues.apache.org/jira/projects/SPARK/issues>`_ | |examples|_ | `Community <https://spark.apache.org/community.html>`_ | `Historical versions of documentation <history/index.html>`_
Copy link
Member

Choose a reason for hiding this comment

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

Is there another website showing such a link? I think the wording is a bit too long, given that it is not supposed to be frequently used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, let me try turning it into a dropdown combobox form.

@HyukjinKwon
Copy link
Member

HyukjinKwon commented Aug 11, 2023

@panbingkun
Copy link
Contributor Author

panbingkun commented Aug 11, 2023

Can we have a dropdown box like https://pandas.pydata.org/docs/ Screenshot 2023-08-11 at 9 56 44 AM

https://koalas.readthedocs.io/en/latest/ Screenshot 2023-08-11 at 9 57 24 AM

You could refer to https://github.com/pandas-dev/pandas/tree/main/doc/source

Thanks, let me do it.

@panbingkun
Copy link
Contributor Author

@gengliangwang @HyukjinKwon
What do you think of the following style?
image

"name": "0.7.0",
"version": "0.7.0"
}
]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why are there no links for versions below 0.7.0? I found that there are no corresponding pyspark documents for versions below 0.7.0 in the historical directory.
image
https://spark.apache.org/docs

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that is because we don't have PySpark before 0.7 :)

https://spark.apache.org/releases/spark-release-0-7-0.html

image

@allisonwang-db
Copy link
Contributor

@panbingkun The latest screenshot looks good! I am wondering if we should 1) remove the preview docs from the version dropdown and 2) make it by default point to the latest released docs?

@zhengruifeng
Copy link
Contributor

the new doc looks pretty good!

@panbingkun
Copy link
Contributor Author

panbingkun commented Aug 15, 2023

@panbingkun The latest screenshot looks good! I am wondering if we should 1) remove the preview docs from the version dropdown and 2) make it by default point to the latest released docs?

1.Okay, done.
2.When we release a new version and generate pyspark docs, the 'release' value will be set to RELEASE_VERSION,

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = 'master'
# The full version, including alpha/beta/rc tags.
release = os.environ.get('RELEASE_VERSION', version)

and the default value for dropbox has also been set to 'release' as shown:
image
https://github.com/apache/spark/pull/42428/files#diff-0711e6775ff3eb4e0fb47fc40afecfe946211842573dae2c5eb872bbe53df45fR2-R5

In the test below when I set RELEASE_VERSION to 3.4.1, the page will look like this:
image
The style seems to be what we want, or do we need to set its default value to latest?

@zhengruifeng
Copy link
Contributor

@gengliangwang @HyukjinKwon would you mind taking another look when you find some time?

@zhengruifeng
Copy link
Contributor

hi @panbingkun if we see the built doc here,

image

the drop down is like following, is this expected?

image

@panbingkun
Copy link
Contributor Author

panbingkun commented Aug 16, 2023

hi @panbingkun if we see the built doc here,

image

the drop down is like following, is this expected?

image

@gengliangwang Due to access issues with Ajax's cross origin, we need to open it locally in this way for test:
Open - n - a/Applications/Google Chrome. app/Content/MacOS/Google Chrome -- args -- user data dir="/tmp/chrome_dev_test" -- disable web security
😄

@@ -0,0 +1,278 @@
[
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we better remove EOL releases ... but no strong opinion WDYT @srowen and @dongjoon-hyun ?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, let's just start with latest versions even, as a convenience to switch. People can always find older versions manually, but we don't need to make them extra discoverable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Member

Choose a reason for hiding this comment

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

We have to remember to update this with new releases - I wonder, do we have another document to add that step to?

Also I think we could even just retain the latest versions in each release branch?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I will add this logic to release-build. sh, which is what I want to do in the next PR,
Or should we continue to do it in this PR, which is more suitable? 😄

@@ -0,0 +1,60 @@
<div id="version-button" class="dropdown">
Copy link
Member

Choose a reason for hiding this comment

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

Let's put the license header:

<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License.  You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

Copy link
Member

@HyukjinKwon HyukjinKwon left a comment

Choose a reason for hiding this comment

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

Looks pretty good otherwise, cc @gengliangwang and @sarutak FYI

@@ -0,0 +1,278 @@
[
Copy link
Member

Choose a reason for hiding this comment

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

Yes, let's just start with latest versions even, as a convenience to switch. People can always find older versions manually, but we don't need to make them extra discoverable

@panbingkun panbingkun requested a review from srowen August 22, 2023 06:12
@HyukjinKwon
Copy link
Member

Alright, let's see how it gose.

Merged to master and branch-3.5.

HyukjinKwon pushed a commit that referenced this pull request Aug 23, 2023
…k doc site

### What changes were proposed in this pull request?
The pr aims to add Spark version drop down to the PySpark doc site.

### Why are the changes needed?
Currently, PySpark documentation does not have a version dropdown. While by default we want people to land on the latest version, it will be helpful and easier for people to find docs if we have this version dropdown.

### Does this PR introduce _any_ user-facing change?
No.

### How was this patch tested?
Manual testing.

```
cd python/docs
make html
```

Closes #42428 from panbingkun/SPARK-44742.

Authored-by: panbingkun <pbk1982@gmail.com>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
(cherry picked from commit 49ba244)
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
@xuanyuanking
Copy link
Member

xuanyuanking commented Aug 29, 2023

@HyukjinKwon @panbingkun I reverted this change in branch-3.5 because it caused a doc build failure. Please assist in fixing this on the master branch. The issue can be reproduced by running the release script using the docs step in dry run mode:

preparing documents... failed
/usr/local/lib/python3.8/dist-packages/nbsphinx.py:1422: RuntimeWarning: You are using an unsupported version of pandoc (2.5).
Your version must be at least (2.14.2) but less than (4.0.0).
Refer to https://pandoc.org/installing.html.
Continuing with doubts...
  nbconvert.utils.pandoc.check_pandoc_version()

Warning, treated as error:
unsupported theme option 'navbar_end' given
make: *** [Makefile:35: html] Error 2
/opt/spark-rm/output/spark/docs/_plugins/copy_api_dirs.rb:130:in `<top (required)>': Python doc generation failed (RuntimeError)
        from /opt/spark-rm/output/spark/docs/.local_ruby_bundle/ruby/2.7.0/gems/jekyll-4.2.1/lib/jekyll/external.rb:60:in `require'
        from /opt/spark-rm/output/spark/docs/.local_ruby_bundle/ruby/2.7.0/gems/jekyll-4.2.1/lib/jekyll/external.rb:60:in `block in require_with_graceful_fail'
        from /opt/spark-rm/output/spark/docs/.local_ruby_bundle/ruby/2.7.0/gems/jekyll-4.2.1/lib/jekyll/external.rb:57:in `each'
        from /opt/spark-rm/output/spark/docs/.local_ruby_bundle/ruby/2.7.0/gems/jekyll-4.2.1/lib/jekyll/external.rb:57:in `require_with_graceful_fail'
        from /opt/spark-rm/output/spark/docs/.local_ruby_bundle/ruby/2.7.0/gems/jekyll-4.2.1/lib/jekyll/plugin_manager.rb:89:in `block in require_plugin_files'
        from /opt/spark-rm/output/spark/docs/.local_ruby_bundle/ruby/2.7.0/gems/jekyll-4.2.1/lib/jekyll/plugin_manager.rb:87:in `each'
        from /opt/spark-rm/output/spark/docs/.local_ruby_bundle/ruby/2.7.0/gems/jekyll-4.2.1/lib/jekyll/plugin_manager.rb:87:in `require_plugin_files'
        from /opt/spark-rm/output/spark/docs/.local_ruby_bundle/ruby/2.7.0/gems/jekyll-4.2.1/lib/jekyll/plugin_manager.rb:21:in `conscientious_require'
        from /opt/spark-rm/output/spark/docs/.local_ruby_bundle/ruby/2.7.0/gems/jekyll-4.2.1/lib/jekyll/site.rb:131:in `setup'
        from /opt/spark-rm/output/spark/docs/.local_ruby_bundle/ruby/2.7.0/gems/jekyll-4.2.1/lib/jekyll/site.rb:36:in `initialize'
        from /opt/spark-rm/output/spark/docs/.local_ruby_bundle/ruby/2.7.0/gems/jekyll-4.2.1/lib/jekyll/commands/build.rb:30:in `new'
        from /opt/spark-rm/output/spark/docs/.local_ruby_bundle/ruby/2.7.0/gems/jekyll-4.2.1/lib/jekyll/commands/build.rb:30:in `process'
        from /opt/spark-rm/output/spark/docs/.local_ruby_bundle/ruby/2.7.0/gems/jekyll-4.2.1/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail'
        from /opt/spark-rm/output/spark/docs/.local_ruby_bundle/ruby/2.7.0/gems/jekyll-4.2.1/lib/jekyll/command.rb:91:in `each'
        from /opt/spark-rm/output/spark/docs/.local_ruby_bundle/ruby/2.7.0/gems/jekyll-4.2.1/lib/jekyll/command.rb:91:in `process_with_graceful_fail'
        from /opt/spark-rm/output/spark/docs/.local_ruby_bundle/ruby/2.7.0/gems/jekyll-4.2.1/lib/jekyll/commands/build.rb:18:in `block (2 levels) in init_with_program'
        from /opt/spark-rm/output/spark/docs/.local_ruby_bundle/ruby/2.7.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
        from /opt/spark-rm/output/spark/docs/.local_ruby_bundle/ruby/2.7.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
        from /opt/spark-rm/output/spark/docs/.local_ruby_bundle/ruby/2.7.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
        from /opt/spark-rm/output/spark/docs/.local_ruby_bundle/ruby/2.7.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
        from /opt/spark-rm/output/spark/docs/.local_ruby_bundle/ruby/2.7.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
        from /opt/spark-rm/output/spark/docs/.local_ruby_bundle/ruby/2.7.0/gems/jekyll-4.2.1/exe/jekyll:15:in `<top (required)>'
        from /opt/spark-rm/output/spark/docs/.local_ruby_bundle/ruby/2.7.0/bin/jekyll:23:in `load'
        from /opt/spark-rm/output/spark/docs/.local_ruby_bundle/ruby/2.7.0/bin/jekyll:23:in `<main>'

@HyukjinKwon
Copy link
Member

Yeah that's fine. Let's revert

@panbingkun
Copy link
Contributor Author

panbingkun commented Aug 30, 2023

Let me investigate the cause.
When I downgraded the pydata_sphinx_theme version locally from 0.8.0 to 0.4.1, this error occurred again
image

So I will submit a new PR and upgrade to the pydata_sphinx_theme version in Docker.

@HyukjinKwon
Copy link
Member

Sure, thanks for investigating this.

dongjoon-hyun pushed a commit that referenced this pull request Aug 30, 2023
…o 0.8.0 in `spark-rm` Dockerfile

### What changes were proposed in this pull request?
The pr is followup #42428.

### Why are the changes needed?
To fix issue:
When our `pydata_sphinx_theme` version is `0.4.1`, there may be issues with not recognizing some configuration items.
<img width="927" alt="image" src="https://github.com/apache/spark/assets/15246973/7ec54bb2-8c28-4863-8374-b3a5369873fc">

### Does this PR introduce _any_ user-facing change?
No.

### How was this patch tested?
Manual testing.

### Was this patch authored or co-authored using generative AI tooling?
No.

Closes #42730 from panbingkun/SPARK-44742_FOLLOWUP.

Authored-by: panbingkun <pbk1982@gmail.com>
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
dongjoon-hyun pushed a commit that referenced this pull request Aug 30, 2023
…o 0.8.0 in `spark-rm` Dockerfile

### What changes were proposed in this pull request?
The pr is followup #42428.

### Why are the changes needed?
To fix issue:
When our `pydata_sphinx_theme` version is `0.4.1`, there may be issues with not recognizing some configuration items.
<img width="927" alt="image" src="https://github.com/apache/spark/assets/15246973/7ec54bb2-8c28-4863-8374-b3a5369873fc">

### Does this PR introduce _any_ user-facing change?
No.

### How was this patch tested?
Manual testing.

### Was this patch authored or co-authored using generative AI tooling?
No.

Closes #42730 from panbingkun/SPARK-44742_FOLLOWUP.

Authored-by: panbingkun <pbk1982@gmail.com>
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
(cherry picked from commit 1712515)
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
7 participants