You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by gu...@apache.org on 2023/11/29 06:05:05 UTC

(spark) branch master updated: [SPARK-46117][DOCS][PYTHON] Enhancing readability of PySpark API reference by hiding verbose typehints

This is an automated email from the ASF dual-hosted git repository.

gurwls223 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 14d854beeab [SPARK-46117][DOCS][PYTHON] Enhancing readability of PySpark API reference by hiding verbose typehints
14d854beeab is described below

commit 14d854beeabcf872175edfd65cb6475ecb7d0ae7
Author: Haejoon Lee <ha...@databricks.com>
AuthorDate: Wed Nov 29 15:04:53 2023 +0900

    [SPARK-46117][DOCS][PYTHON] Enhancing readability of PySpark API reference by hiding verbose typehints
    
    ### What changes were proposed in this pull request?
    
    This PR proposes an enhancement of readability of the PySpark API reference by hiding verbose typehints. This change aims to improve the readability of the documentation by reducing verbosity in the function/method signatures.
    
    ### Why are the changes needed?
    
    Currently, the PySpark API documentation displays all type hints in the signatures, which can make the documentation appear cluttered and less readable.
    
    By setting `autodoc_typehints` to 'none', we can achieve a cleaner and more concise presentation of our API, similar to how the Pandas documentation handles type hints.
    
    This approach has been effective in Pandas, making the documentation more approachable and easier to understand. We should follow the good example and apply the same behavior to the PySpark API reference.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No API changes, but the API reference turn into more readable as below:
    
    ## Before
    
    <img width="747" alt="Screenshot 2023-11-27 at 3 53 33 PM" src="https://github.com/apache/spark/assets/44108233/35bb0ccc-0730-43ae-80d6-258d14c4d493">
    
    ## After
    
    <img width="762" alt="Screenshot 2023-11-27 at 3 54 36 PM" src="https://github.com/apache/spark/assets/44108233/bd2e7c37-8e87-4d0d-9d73-d17d49ebb229">
    
    ### How was this patch tested?
    
    Manually built docs.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    No.
    
    Closes #44035 from itholic/hide_typehints.
    
    Authored-by: Haejoon Lee <ha...@databricks.com>
    Signed-off-by: Hyukjin Kwon <gu...@apache.org>
---
 python/docs/source/conf.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/python/docs/source/conf.py b/python/docs/source/conf.py
index e116f2bcb8c..6a4f6adc5e6 100644
--- a/python/docs/source/conf.py
+++ b/python/docs/source/conf.py
@@ -180,6 +180,7 @@ pygments_style = 'sphinx'
 # Look at the first line of the docstring for function and method signatures.
 autodoc_docstring_signature = True
 autosummary_generate = True
+autodoc_typehints = "none"
 
 # -- Options for HTML output ----------------------------------------------
 


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