Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execution path not correct #160

Closed
twsl opened this issue Jun 9, 2023 · 2 comments
Closed

Execution path not correct #160

twsl opened this issue Jun 9, 2023 · 2 comments

Comments

@twsl
Copy link

twsl commented Jun 9, 2023

I'm using the official Databricks extension in vscode to sync my workspace folder to the repository folder in Databricks. Unfortunately, this extension doesnt respect this setting and assumes a wrong workspace path.

NotebookKernel: Setting up FilesInWorkspace support for file:///workspaces/databricks-template/notebooks/test.ipynb
POST 1.2/commands/execute --> {"clusterId":"xxxxxxxxxxxxxxx","language":"python","contextId":"83695628014xxxxxxx","command":"import os\nos.chdir('/Workspace/workspaces/databricks-template/notebooks')\nimport sys\nsys.path.append('/Workspace/workspaces/databricks-template/notebooks')"}

and later returns the following response because the files do not exist.

Response: {"id":"3fc6eb75-b7fe-4b72-825f-1c1987ff9dd4","status":"Finished","results":{"resultType":"error","summary":"<span class='ansi-red-fg'>FileNotFoundError</span>: [Errno 2] No such file or directory: '/W ...
<span class='ansi-red-fg'>FileNotFoundError</span>: [Errno 2] No such file or directory: '/Workspace/workspaces/databricks-template/notebooks'
�[0;31m---------------------------------------------------------------------------�[0m
�[0;31mFileNotFoundError�[0m                         Traceback (most recent call last)
File �[0;32m<command--1>:2�[0m
�[1;32m      1�[0m �[38;5;28;01mimport�[39;00m �[38;5;21;01mos�[39;00m
�[0;32m----> 2�[0m os�[38;5;241m.�[39mchdir(�[38;5;124m'�[39m�[38;5;124m/Workspace/workspaces/databricks-template/notebooks�[39m�[38;5;124m'�[39m)
�[1;32m      3�[0m �[38;5;28;01mimport�[39;00m �[38;5;21;01msys�[39;00m
�[1;32m      4�[0m sys�[38;5;241m.�[39mpath�[38;5;241m.�[39mappend(�[38;5;124m'�[39m�[38;5;124m/Workspace/workspaces/databricks-template/notebooks�[39m�[38;5;124m'�[39m)

�[0;31mFileNotFoundError�[0m: [Errno 2] No such file or directory: '/Workspace/workspaces/databricks-template/notebooks'

As a result, the execution path is obviously wrong.

Is there any way to specify the expected execution path or respect the sync location?

@gbrueckl
Copy link
Collaborator

this should be fixed with v2.2.0 which I just released

you should now be able to use import relative the root of the synced workspace
or load files relative to your current notebook

@gbrueckl
Copy link
Collaborator

closing as fixed with no further feedback provided

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

No branches or pull requests

2 participants