Hyukjin Kwon created SPARK-61203:
------------------------------------
Summary: Make pyspark.sql.functions an attribute of pyspark.sql
once pyspark.sql is imported, as PySpark does
Key: SPARK-61203
URL: https://issues.apache.org/jira/browse/SPARK-61203
Project: Spark
Issue Type: Bug
Components: Connect
Affects Versions: connect-rust-4.3.0
Reporter: Hyukjin Kwon
After `import pyspark.sql`, `pyspark.sql.functions` raised AttributeError in
the Python client until pyspark.sql.functions was imported explicitly.
PySpark's modules import the functions package, so `functions` is an attribute
of pyspark.sql there.
Repro: `import pyspark.sql; pyspark.sql.functions.col("a")` fails with "module
'pyspark.sql' has no attribute 'functions'" in the drop-in and gives
Column<'a'> in PySpark 4.3.0.
The fix imports the functions submodule in pyspark/sql/__init__.py. The set of
names of dir(pyspark.sql) then equals PySpark's.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]