AI in Databricks – A New Level of Comfort and Aesthetics in Programming

17 January 2025

Databricks continuously enhances its features to simplify and improve the workflow of data professionals. One such enhancement is the introduction of “slash commands,” quick commands that enable intuitive use of the Databricks Assistant within notebooks.

Coding is not just about solving problems and implementing functionalities; it’s also about ensuring readability and aesthetics. With AI integration in Databricks, developers gain an assistant, significantly enhancing their work experience. Automatic code formatting eliminates structural chaos, ensuring a consistent and transparent appearance that simplifies analysis and further modifications.

On-the-fly documentation generation makes code more comprehensible for its creator and team. Moreover, optimization features help avoid inefficient constructions, making the code visually appealing and more efficient. This feature saves time and increases precision, critical in daily work with large datasets. AI in Databricks is a step toward a more intuitive, aesthetic, and developer-friendly environment that turns coding into a pleasure.

“Slash commands” are an innovative tool that allows users to perform many tasks directly in the notebook while maintaining full control over the changes made. For instance, the assistant can automatically identify errors in the code, suggest corrections, and present them in a diff view, enabling users to review changes before accepting them. This ensures users have complete control over modifications. Users can provide more details in their prompts if the code requires further refinement and request a new solution proposal.

The ability to explain code provides users with a better understanding of how individual parts work, which is particularly useful for teamwork and debugging. This feature also supports SQL query optimization, code formatting for improved readability, and automatic suggestions for organizing and naming within the notebook. All these actions are performed quickly and intuitively, reducing the need to search documentation or analyze errors manually.

The documentation includes a very helpful list of shortcut slash commands for the most commonly used prompts:

Prompt text

What Assistant does
/

 

Displays common commands

 

 

/doc

 

Comments the code in a diff view

 

/explain

 

Provides an explanation of the code in a cell

 

/fix

 

Proposes a fix to any code errors in a diff view

/findTables

 

Searches for relevant tables based on Unity Catalog metadata. To find features or feature tables, mention “features” or “feature tables” in the query. See Find features and feature tables using Databricks Assistant.

 

/findQueries

 

Searches for relevant queries based on Unity Catalog metadata.

 

/optimize

 

Improves inefficient SQL queries.

 

/prettify

 

Formats code for readability.

 

/rename

 

Suggests updated names to notebook cells and other elements, depending on the context.

 

/settings

 

Adjusts your notebook settings directly from Assistant.

 

source: Use Databricks Assistant – Azure Databricks | Microsoft Learn

 

Below, you will find examples of how these shortcuts speed up and streamline code development and its interpretation:

 

  • /

 

  • /doc

 

  • /explain

 

  • /fix
  • /optimize

 

  • /prettify

 

  • /rename

 

“Slash commands” in Databricks are handy tools that simplify working with code and data. With intuitive commands, users can quickly identify errors, optimize code, format it, and add comments, enhancing efficiency and improving the quality of results.

This feature is especially valuable in team environments, where speed and precision are crucial. With this functionality, Databricks reaffirms its position as a leading platform for data professionals, providing modern solutions to contemporary analytical challenges.