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

   ### What changes were proposed in this pull request?
   
   [SPARK-61060](https://issues.apache.org/jira/browse/SPARK-61060): 
`pyspark.conf` and `pyspark.taskcontext` are vendored from Apache Spark v4.3.0, 
and `pyspark` exports the names of the PySpark client.
   
   As the PySpark client's `pyspark` of a Connect-only client, `pyspark` now 
exports:
   - the `SparkConf` of `pyspark.conf`, which keeps its settings in Python
   - the `TaskContext`, `BarrierTaskContext` and `BarrierTaskInfo` of 
`pyspark.taskcontext`
   - `Accumulator`, `AccumulatorParam`, `MarshalSerializer`, 
`CPickleSerializer`, `Profiler` and `BasicProfiler`, of their modules
   - `keyword_only`, and a `since` that appends the version to the docstring of 
a function
   
   The names of the classic `SparkContext`, such as `RDD` and `SparkFiles`, 
which need a JVM, are still not exported, as in a Connect-only PySpark client. 
`pyspark.conf` and `pyspark.taskcontext` are pure Python, byte-identical to the 
tag, and the drift check covers them.
   
   ### Why are the changes needed?
   
   The client had neither module, so `from pyspark import TaskContext` raised 
an `ImportError`. Its `SparkConf` was a stub of `set`, `get`, `remove` and a 
`setAll` of a dict. It lacked `setAppName`, `setMaster`, `setIfMissing`, 
`contains`, `toDebugString` and the other methods of PySpark's. The tests of 
the stub now check those of PySpark's `SparkConf` and `since`.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. `pyspark` has the modules and names of the PySpark 4.3.0 client.
   
   ### How was this patch tested?
   
   - A new live test sets the settings of a `SparkConf` on a session through 
the builder, and runs a UDF of `TaskContext.get().partitionId()`. It passes 
with official PySpark 4.3.0, and fails without this change.
   - New and changed offline tests check the names that `pyspark` exports, the 
`SparkConf` of PySpark, `since` and `keyword_only`.
   - The lib tests of both crates (582 passed), the build of all tests, also 
with `wasm-udf`, the offline Python suites (1908 passed, 8 skipped), and the 
live drop-in and Arrow suites (120 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