bring back bread crumbs

This commit is contained in:
Fabian Jakobs 2024-03-04 13:02:41 +01:00
parent ff886e3cf0
commit 32328c178b
No known key found for this signature in database
1 changed files with 10 additions and 0 deletions

View File

@ -1,3 +1,10 @@
{{/*
The below works around a problematic error message from Databricks Connect.
The standard SparkSession is supported in all configurations (workspace, IDE,
all runtime versions, CLI). But on the CLI it currently gives a confusing
error message if SPARK_REMOTE is not set. Here we import the DatabricksSession
as SparkSession so the rest of the code looks as expected.
*/}}
from databricks.connect import DatabricksSession as SparkSession
from pytest import fixture
from {{.project_name}} import main
@ -5,6 +12,9 @@ from {{.project_name}} import main
@fixture(scope="session")
def spark():
# Create a new Databricks Connect session. If this fails, you should
# check that you have configured Databricks Connect correctly.
# See https://docs.databricks.com/dev-tools/databricks-connect.html.
spark = SparkSession.builder.getOrCreate()
yield spark
spark.stop()