Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-44410][PYTHON][CONNECT] Set active session in create, not just…
… getOrCreate ### What changes were proposed in this pull request? ML and other uses rely on _active_spark_session to find spark session. Sessions created using getOrCreate method set this variable, but sessions created with create don't. Update create method to set _active_spark_session. ### Why are the changes needed? This breaks spark connect customers, such as pyspark.ml and pandas from finding created session if it was created with create. ### Does this PR introduce _any_ user-facing change? Sessions created by create are set as current session. This is slightly different behavior then before, however this suits interest of almost all clients. The only case it might break is if someone uses mix of both `create` and `getOrCreate` relying on this exact semantic. We can hide it under configuration flag, e.g. `create(set_active_session=False)` if undesired. In this case clients who use `create` and want to use pyspark.ml/pandas will need to update to set it to True. ### How was this patch tested? UT Closes apache#41987 from cdkrot/spark_session_create_store_session. Authored-by: Alice Sayutina <[email protected]> Signed-off-by: Hyukjin Kwon <[email protected]>
- Loading branch information