Skip to content

Conversation

@pietern
Copy link
Contributor

@pietern pietern commented Oct 15, 2024

No description provided.

"import sys\n",
"from databricks.sdk.runtime import dbutils\n",
"bundle_file_path = dbutils.widgets.get(\"bundle_file_path\")\n",
"sys.path.append(bundle_file_path)"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious if this solves the customer problem. But there's another approach here where you could support interactive execution as well: you could have a %run ./add-sys-path here. The add-sys-path would then be a notebook that does something like https://github.com/databricks/bundle-examples/blob/main/default_python/fixtures/.gitkeep#L11 to add its containing folder to the sys path.

"outputs": [],
"source": [
"import sys\n",
"from databricks.sdk.runtime import dbutils\n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to import dbutils from the SDK here? It seems like this notebook will only be run from the workspace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants