File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
flights/flights-liquibase/tests/unit_transforms Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 9999 DATABRICKS_HOST : ${{ secrets.DATABRICKS_HOST }}
100100 DATABRICKS_TOKEN : ${{ secrets.DATABRICKS_TOKEN_TST }}
101101 DATABRICKS_CLUSTER_ID : ${{ secrets.DATABRICKS_CLUSTER_ID }}
102+ DBCONNECT_SERVERLESS : " true"
102103 run : |
103104 pytest flights/flights-liquibase/tests/
104105
Original file line number Diff line number Diff line change 77def spark_session ():
88 try :
99 from databricks .connect import DatabricksSession
10- return DatabricksSession .builder .profile ("adb" ).getOrCreate ()
10+ if os .environ .get ("DBCONNECT_SERVERLESS" , "false" ).lower () == "true" :
11+ return DatabricksSession .builder .serverless (True ).getOrCreate ()
12+ else :
13+ return DatabricksSession .builder .getOrCreate ()
14+ # except (ValueError, RuntimeError):
15+ # from databricks.connect import DatabricksSession
16+ # return DatabricksSession.builder.profile("unit_tests").getOrCreate()
1117 except ImportError :
1218 print ("No Databricks Connect, build and return local SparkSession" )
1319 from pyspark .sql import SparkSession
You can’t perform that action at this time.
0 commit comments