databricks-sdk-py icon indicating copy to clipboard operation
databricks-sdk-py copied to clipboard

[ISSUE] notebook.entry_point.getDbutils().notebook().getContext().userName().get() not overridden in dbutils

Open TumbleTuesday opened this issue 1 year ago • 0 comments

Describe the bug notebook.entry_point.getDbutils().notebook().getContext().userName().get() does not get overrriden when used through Databricks Connect / VS Code Extension. This causes the python file to error out.

To Reproduce Steps to reproduce the behavior:

Insert notebook.entry_point.getDbutils().notebook().getContext().userName().get() into a .py file and attempt to run (after implementing spark and package imports etc.) See error Additional context

notebook.entry_point.getDbutils().notebook().getContext().notebookPath().get()

does get overriden however in [databricks.sdk.dbutils.py]([http://databricks.sdk.dbutils.py/]](http://databricks.sdk.dbutils.py/%5D) so can this same method be done for the userName() call?

proxy_override_paths = { 'notebook.entry_point.getDbutils().notebook().getContext().notebookPath().get()': get_local_notebook_path, 'notebook.entry_point.getDbutils().notebook().getContext().userName().get()': get_local_notebook_path, }

TumbleTuesday avatar Mar 20 '25 09:03 TumbleTuesday