HyukjinKwon opened a new pull request, #42628:
URL: https://github.com/apache/spark/pull/42628

   ### What changes were proposed in this pull request?
   
   This PR proposes the alias name `sf` instead of `F` for 
`pyspark.sql.functions` alias in public documentation:
   
   ```python
   from pyspark.sql import functions as sf
   ```
   
   This PR does not change the internal or test codes as it's too invasive, and 
might easily cause conflicts.
   
   ### Why are the changes needed?
   
   ```python
   from pyspark.sql import functions as F
   ```
   
   isn’t very Pythonic - it does not follow PEP 8, see [Package and Module 
Names](https://peps.python.org/pep-0008/#package-and-module-names).
   
   > Modules should have short, all-lowercase names. Underscores can be used in 
the module name if it improves
   > readability. Python packages should also have short, all-lowercase names, 
although the use of underscores
   > is discouraged.
   
   Therefore, the module’s alias should follow this. In practice, the uppercase 
is only used at the module/package
   level constants in my experience, see also 
[Constants](https://peps.python.org/pep-0008/#constants).
   
   See also [this stackoverflow 
comment](https://stackoverflow.com/questions/70458086/how-to-correctly-import-pyspark-sql-functions#comment129714058_70458115).
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes, it changes documentation so users 
   
   ### How was this patch tested?
   
   Manually checked.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   No.


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to