mirror of https://github.com/databricks/cli.git
bring back bread crumbs
This commit is contained in:
parent
ff886e3cf0
commit
32328c178b
|
@ -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 databricks.connect import DatabricksSession as SparkSession
|
||||||
from pytest import fixture
|
from pytest import fixture
|
||||||
from {{.project_name}} import main
|
from {{.project_name}} import main
|
||||||
|
@ -5,6 +12,9 @@ from {{.project_name}} import main
|
||||||
|
|
||||||
@fixture(scope="session")
|
@fixture(scope="session")
|
||||||
def spark():
|
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()
|
spark = SparkSession.builder.getOrCreate()
|
||||||
yield spark
|
yield spark
|
||||||
spark.stop()
|
spark.stop()
|
||||||
|
|
Loading…
Reference in New Issue