This article describes how to use the Databricks Connect integration in the Databricks extension for Visual Studio Code to run and debug individual Python (.py
) files. For information about the extension, see What is the Databricks extension for Visual Studio Code?.
The Databricks Connect integration also allows you to run and debug notebook cells. See Run and debug notebook cells with Databricks Connect using the Databricks extension for Visual Studio Code.
RequirementsâBefore you can use Databricks Connect from within the Databricks extension for Visual Studio Code, you must first meet the Databricks Connect requirements. These requirements include things such as a Unity Catalog-enabled workspace, compute requirements, and version requirements for your local installation of Python.
Activate a Python virtual environmentâActivate a Python virtual environment for your Python project. Python virtual environments help to make sure that your project is using compatible versions of Python and Python packages (in this case, the Databricks Connect package).
In the Configuration pane:
In the Configuration view under Python Environment:
<environment-name>
.â Click Install.note
If you use Poetry, you can synchronize your pyproject.toml
and poetry.lock
files with the installed Databricks Connect package (and its dependencies) by running the following command. Be sure to replace 13.3.2
with the version of the Databricks Connect package that matches the one that was installed by the Databricks extension for Visual Studio Code for your project.
Bash
poetry add databricks-connect==13.3.2
Run or debug your Python codeâ
After you enable Databricks Connect, run or debug your Python file (.py
):
In your project, open the Python file that you want to run or debug.
Set any debugging breakpoints within the Python file.
Click the Run on Databricks icon next to the list of editor tabs, and then click Debug current file with Databricks Connect.
The output appears in the Debug Console pane.
You can also right-click the .py
file, and then click Run on Databricks > Debug current file with Databricks Connect.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4