You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Hyukjin Kwon (Jira)" <ji...@apache.org> on 2021/11/10 09:40:00 UTC

[jira] [Resolved] (SPARK-37022) Use black as a formatter for the whole PySpark codebase.

     [ https://issues.apache.org/jira/browse/SPARK-37022?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hyukjin Kwon resolved SPARK-37022.
----------------------------------
    Fix Version/s: 3.3.0
       Resolution: Fixed

Issue resolved by pull request 34297
[https://github.com/apache/spark/pull/34297]

> Use black as a formatter for the whole PySpark codebase.
> --------------------------------------------------------
>
>                 Key: SPARK-37022
>                 URL: https://issues.apache.org/jira/browse/SPARK-37022
>             Project: Spark
>          Issue Type: Improvement
>          Components: PySpark
>    Affects Versions: 3.3.0
>            Reporter: Maciej Szymkiewicz
>            Assignee: Maciej Szymkiewicz
>            Priority: Major
>             Fix For: 3.3.0
>
>         Attachments: black-diff-stats.txt, pyproject.toml
>
>
> [{{black}}|https://github.com/psf/black] is a popular Python code formatter. It is used by a number of projects, both small and large, including prominent ones, like pandas, scikit-learn, Django or SQLAlchemy. Black is already used to format a {{pyspark.pandas}} and (though not enforced) stubs files.
> We should consider using black to enforce formatting of all PySpark files. There are multiple reasons to do that:
>  - Consistency: black is already used across existing codebase and black formatted chunks of code are already added to modules other than pyspark.pandas as a result of type hints inlining (SPARK-36845).
>  - Lower cost of contributing and reviewing: Formatting can be automatically enforced and applied.
>  - Simplify reviews: In general, black formatted code, produces small and highly readable diffs.
>  - Reduce effort required to maintain patched forks: smaller diffs + predictable formatting.
> Risks:
>  - Initial reformatting requires quite significant changes.
>  - Applying black will break blame in GitHub UI (for git in general see [Avoiding ruining git blame|https://black.readthedocs.io/en/stable/guides/introducing_black_to_your_project.html?highlight=blame#avoiding-ruining-git-blame]).
> Additional steps:
>  - To simplify backporting, black will have to be applied to all active branches.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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