File tree 2 files changed +9
-3
lines changed
2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 20
20
* Fixed deprecated load and save approaches of GBQTableDataset and GBQQueryDataset by invoking save and load directly over ` pandas-gbq ` lib
21
21
22
22
## Breaking Changes
23
+ * Now ` _get_spark() ` does not use ` databricks-connect ` by default when run in a Databricks notebook
24
+
23
25
## Community contributions
24
26
Many thanks to the following Kedroids for contributing PRs to this release:
25
27
* [ Brandon Meek] ( https://github.com/bpmeek )
26
28
* [ yury-fedotov] ( https://github.com/yury-fedotov )
27
29
* [ gitgud5000] ( https://github.com/gitgud5000 )
28
30
* [ janickspirig] ( https://github.com/janickspirig )
29
31
* [ Galen Seilis] ( https://github.com/galenseilis )
32
+ * [ MigQ2] ( https://github.com/MigQ2 )
30
33
31
34
32
35
# Release 4.1.0
Original file line number Diff line number Diff line change @@ -38,7 +38,10 @@ def _get_spark() -> Any:
38
38
extended configuration mechanisms and notebook compatibility,
39
39
otherwise we use classic pyspark.
40
40
"""
41
- try :
41
+ if (
42
+ "DATABRICKS_RUNTIME_VERSION" in os .environ
43
+ and int (os .environ ["DATABRICKS_RUNTIME_VERSION" ].split ("." )[0 ]) >= 13
44
+ ):
42
45
# When using databricks-connect >= 13.0.0 (a.k.a databricks-connect-v2)
43
46
# the remote session is instantiated using the databricks module
44
47
# If the databricks-connect module is installed, we use a remote session
@@ -47,9 +50,9 @@ def _get_spark() -> Any:
47
50
# We can't test this as there's no Databricks test env available
48
51
spark = DatabricksSession .builder .getOrCreate () # pragma: no cover
49
52
50
- except ImportError :
53
+ else :
51
54
# For "normal" spark sessions that don't use databricks-connect
52
- # we get spark normally
55
+ # or for databricks-connect<13 we get spark " normally"
53
56
spark = SparkSession .builder .getOrCreate ()
54
57
55
58
return spark
You can’t perform that action at this time.
0 commit comments