What is the correct way to alias pyspark.sql.functions? Is it import pyspark.sql.functions as F or as f?

Viewed 46

I understand that according to PEP8 rules, we should import modules and packages using lower case letters. In that case, we should be importing using: import pyspark.sql.functions as f.

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. See: https://peps.python.org/pep-0008/#package-and-module-names

My question therefore is whether there is a reason why so many developers use the capital F instead of lower f?

0 Answers
Related