Settings for the Databricks extension for Visual Studio Code

This article lists extension settings for the Databricks extension for Visual Studio Code. See What is the Databricks extension for Visual Studio Code?

Settings reference

The Databricks extension for Visual Studio Code adds the following settings to Visual Studio Code. Open the Settings editor using the Visual Studio Code Command Palette command Preferences: Open Settings. The settings.json file can also be modified directly.

Settings editor (Extensions > Databricks) settings.json Description
Bundles: Remove State Refresh Interval databricks.bundle.remoteStateRefreshInterval The interval in minutes at which the remote state of the bundle is refreshed.
Clusters: Only Show Accessible Clusters databricks.clusters.onlyShowAccessibleClusters Checked or set to true to enable filtering for only those clusters that you can run code on.

The default is unchecked or false (do not enable filtering for those clusters).
Experiments: Opt Into databricks.experiments.optInto Enables or disables experimental features for the extension. Available features include:

- views.cluster: Shows or hides the Clusters view. See Select a cluster for running code and jobs.
Ipython Dir databricks.ipythonDir The absolute path to a directory for storing IPython files. The default is the IPYTHONDIR environment variable if it is set, or ~/.ipython.
Logs: Enabled databricks.logs.enabled Whether to enable logging. The default is true. Reload your window for changes to take effect.
Logs: Max Array Length databricks.logs.maxArrayLength The maximum number of items to show for array fields. The default is 2.
Logs: Max Field Length databricks.logs.maxFieldLength The maximum length of each field displayed in the logs output panel. The default is 40.
Logs: Truncation Depth databricks.logs.truncationDepth The maximum depth of logs to show without truncation. The default is 2.
Override Databricks Config File databricks.overrideDatabricksConfigFile An alternate location for the .databrickscfg file that the extension uses for authentication.
Wsfs: Rearrange Cells databricks.wsfs.rearrangeCells Enable or disable rearranging cells in wrapper files created when using workspace as the sync destination. Databricks recommends keeping this setting enabled. If it is disabled, you will need to manually handle the sys.path for local imports in your notebooks.

Environment variable definitions files

Visual Studio Code supports environment variable definitions files for Python projects. You create a file with the extension .env, and Visual Studio Code applies the environment variables within this .env file at run time. For more information, see Environment variable definitions file in the Visual Studio Code documentation.

The Databricks extension for Visual Studio Code uses the python.envFile setting for the location of an environment variable definitions file. The default value for this Visual Studio Code setting is {workspaceFolder}/.env, but you can modify it using the Settings editor or in settings.json. These environment variables are only applied when code is run locally.