HyukjinKwon opened a new pull request, #300:
URL: https://github.com/apache/spark-connect-rust/pull/300

   ### What changes were proposed in this pull request?
   
   [SPARK-61095](https://issues.apache.org/jira/browse/SPARK-61095): 
`pyspark.sql` now has the modules `geo_utils`, `sql_formatter`, `table_arg` and 
`tvf_argument`, as the PySpark client's `pyspark.sql` package does.
   
   - `geo_utils`, the spatial reference systems of the spatial types, and 
`sql_formatter`, `SQLStringFormatter`, are vendored from Apache Spark v4.3.0. 
The drift check covers them.
   - `tvf_argument` has `TableValuedFunctionArgument`. A `Column` and a 
`TableArg` are instances of it: the drop-in's are Rust-backed classes, so they 
are registered as its virtual subclasses.
   - `table_arg` has `TableArg`, the Rust-backed class of `DataFrame.asTable()`.
   - As PySpark's, `import pyspark.sql` imports its submodules `conf`, 
`geo_utils`, `profiler`, `sql_formatter`, `streaming`, `table_arg`, 
`tvf_argument` and `variant_utils`, so they are attributes of `pyspark.sql`.
   
   ### Why are the changes needed?
   
   The PySpark client ships these four modules in its `pyspark.sql` package 
(`connect_packages`), but the drop-in lacked them: `from pyspark.sql.table_arg 
import TableArg` raised a `ModuleNotFoundError`. Also, `pyspark.sql.streaming` 
and the other submodules were not attributes of `pyspark.sql` until they were 
imported themselves.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. These modules, and the attributes of `pyspark.sql`, are those of the 
PySpark 4.3.0 client.
   
   ### How was this patch tested?
   
   - A new live test checks that `DataFrame.asTable()` and its `partitionBy` 
are `TableArg`s of `pyspark.sql.table_arg`, and `TableValuedFunctionArgument`s. 
It passes with official PySpark 4.3.0 and fails without this change.
   - A new offline test checks the four modules, the attributes of 
`pyspark.sql`, and that a `Column` and a `TableArg` are 
`TableValuedFunctionArgument`s.
   - A comparison of the names of 23 modules with official PySpark 4.3.0 found 
these modules missing. The other names that differ come from the imports and 
type aliases inside PySpark's modules, or are classic APIs.
   - The lib tests of both crates (595 passed), the build of all tests, also 
with `wasm-udf`, the offline Python suites (2047 passed, 12 skipped), and the 
live drop-in and Arrow suites (151 passed) and live cases (10 passed) against a 
local Spark 4.3.0 server. Clippy reports no diagnostics in the changed lines.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Opus 5.5
   
   This pull request and its description were written by Isaac.
   


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