Skip to main content

Data Engineering

New

Fabric Notebooks: autoformat code cell

Vote (5) Share
Martin Bode's profile image

Martin Bode on 13 Dec 2023 16:43:36

Databricks already allows users to format code cells:

https://cms.databricks.com/sites/default/files/inline-images/pythonformatting-databricks.gif

https://www.databricks.com/blog/2023/01/30/introducing-upgrades-databricks-notebooks-new-editor-python-formatting-and-more#:~:text=Python%20code%20formatting


This works for Python and SQL code.


This provides several advantages:

  • users don’t have to think about formatting; they just need to hit a button
  • there is no more arguing between different devs concerning their individual formatting preference (because it is enforced centrally)
  • if consistently applied (before every commit) GIT diff will be much cleaner because it will not include any ´pure formatting changes that had no functional impact