forked from mrpowers-io/quinn
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update workflows & pytest to choose the Sparksession instance based o…
…n a condition
- Loading branch information
1 parent
b5f6749
commit 6cdd1d2
Showing
3 changed files
with
9 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
import os | ||
from pyspark.sql import SparkSession | ||
|
||
spark = SparkSession.builder.master("local").appName("chispa").getOrCreate() | ||
if "SPARK_CONNECT_MODE_ENABLE" in os.environ: | ||
spark = SparkSession.builder.remote("sc://localhost:15002").getOrCreate() | ||
else: | ||
spark = SparkSession.builder.master("local").appName("chispa").getOrCreate() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters