Skip to content

[SPARK-42187][CONNECT][TESTS] Avoid using RemoteSparkSession.builder.getOrCreate in tests#39743

Closed
HyukjinKwon wants to merge 2 commits intoapache:masterfrom
HyukjinKwon:cleanup-test
Closed

[SPARK-42187][CONNECT][TESTS] Avoid using RemoteSparkSession.builder.getOrCreate in tests#39743
HyukjinKwon wants to merge 2 commits intoapache:masterfrom
HyukjinKwon:cleanup-test

Conversation

@HyukjinKwon
Copy link
Copy Markdown
Member

What changes were proposed in this pull request?

This PR proposes to use pyspark.sql.SparkSession.getOrCreate instead of pyspark.sql.connect.Sparksession.builder.getOrCreate.

Why are the changes needed?

Because pyspark.sql.connect.Sparksession.builder.getOrCreate is supposed to be internal, and it does not have the unified handling of the Spark sessions for both PySpark session and Spark Connect sessions.

Does this PR introduce any user-facing change?

No, test-only.

How was this patch tested?

Unittests fixed.

@HyukjinKwon HyukjinKwon marked this pull request as draft January 25, 2023 13:41
@HyukjinKwon HyukjinKwon marked this pull request as ready for review January 25, 2023 16:14
Copy link
Copy Markdown
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, LGTM (Pending CIs)

@HyukjinKwon
Copy link
Copy Markdown
Member Author

All passed.

Merged to master and branch-3.4.

HyukjinKwon added a commit that referenced this pull request Jan 26, 2023
…getOrCreate in tests

### What changes were proposed in this pull request?

This PR proposes to use `pyspark.sql.SparkSession.getOrCreate` instead of `pyspark.sql.connect.Sparksession.builder.getOrCreate`.

### Why are the changes needed?

Because `pyspark.sql.connect.Sparksession.builder.getOrCreate` is supposed to be internal, and it does not have the unified handling of the Spark sessions for both PySpark session and Spark Connect sessions.

### Does this PR introduce _any_ user-facing change?

No, test-only.

### How was this patch tested?

Unittests fixed.

Closes #39743 from HyukjinKwon/cleanup-test.

Lead-authored-by: Hyukjin Kwon <gurwls223@apache.org>
Co-authored-by: Hyukjin Kwon <gurwls223@gmail.com>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
(cherry picked from commit 4f60ebc)
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
@HyukjinKwon HyukjinKwon deleted the cleanup-test branch January 15, 2024 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants