You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/03/08 00:29:17 UTC

[GitHub] [spark] HyukjinKwon commented on a change in pull request #31770: [SPARK-34606][DOCS] Redirects for moved PySpark docs

HyukjinKwon commented on a change in pull request #31770:
URL: https://github.com/apache/spark/pull/31770#discussion_r589113277



##########
File path: python/docs/source/conf.py
##########
@@ -177,7 +177,24 @@
 # Add any extra paths that contain custom files (such as robots.txt or
 # .htaccess) here, relative to this directory. These files are copied
 # directly to the root of the documentation.
-#html_extra_path = []
+redirects_dir = 'redirects'
+html_extra_path = [redirects_dir]
+
+os.makedirs(redirects_dir, exist_ok=True)
+for moved_page in ['', '.ml', '.mllib', '.sql', '.streaming']:
+    moved_file = f'pyspark{moved_page}.html'

Review comment:
       I think simply mapping it wouldn't work. For example,
   
   new URL:
   
   ```
   reference/api/pyspark.sql.functions.from_json.html?highlight=from_json#pyspark.sql.functions.from_json
   ```
   
   old URL:
   
   ```
   pyspark.sql.html?highlight=from_json#pyspark.sql.functions.from_json
   ```
   
   Can we leverage other extensions such as https://gitlab.com/documatt/sphinx-reredirects & https://pypi.org/project/sphinx-reredirects/, and just go back to the root page by wildcards?
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org