Skip to content

Commit afe75eb

Browse files
authored
Don't initialise spark progress widget if it's not supported (#1402)
## Changes Don't initialise spark progress widget if it's not supported ## Tests Manually
1 parent 261e06c commit afe75eb

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

packages/databricks-vscode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,7 @@
882882
"databricks.connect.progress": {
883883
"type": "boolean",
884884
"default": true,
885-
"description": "Show PySpark progress bar when using Databricks Connect."
885+
"markdownDescription": "Show PySpark progress bar when using Databricks Connect. Requires `ipywidgets` package and `[email protected]+`."
886886
},
887887
"databricks.ipythonDir": {
888888
"type": "string",

packages/databricks-vscode/resources/python/00-databricks-init.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,9 @@ def register_spark_progress(spark, show_progress: bool):
376376
import ipywidgets as widgets
377377
except Exception as e:
378378
return
379+
380+
if not hasattr(spark, "clearProgressHandlers") or not hasattr(spark, "registerProgressHandler"):
381+
return
379382

380383
class Progress:
381384
SI_BYTE_SIZES = (1 << 60, 1 << 50, 1 << 40, 1 << 30, 1 << 20, 1 << 10, 1)

0 commit comments

Comments
 (0)