Skip to content

Commit

Permalink
Don't initialise spark progress widget if it's not supported (#1402)
Browse files Browse the repository at this point in the history
## Changes
Don't initialise spark progress widget if it's not supported

## Tests
Manually
  • Loading branch information
ilia-db authored Oct 23, 2024
1 parent 261e06c commit afe75eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/databricks-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@
"databricks.connect.progress": {
"type": "boolean",
"default": true,
"description": "Show PySpark progress bar when using Databricks Connect."
"markdownDescription": "Show PySpark progress bar when using Databricks Connect. Requires `ipywidgets` package and `pyspark@3.5.0+`."
},
"databricks.ipythonDir": {
"type": "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,9 @@ def register_spark_progress(spark, show_progress: bool):
import ipywidgets as widgets
except Exception as e:
return

if not hasattr(spark, "clearProgressHandlers") or not hasattr(spark, "registerProgressHandler"):
return

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

0 comments on commit afe75eb

Please sign in to comment.