01-05-2022 05:17 AM
Has anyone found a nice way to run code-formating (like black) on the notebooks **in the workspace**? My current workflow is to commit the file, pull it locally, format, repush and pull. It would be nice if it was some relatively easy way to run black on the notebook up in the workspace, is it?
01-10-2022 09:10 AM
Hi @Erik Parmann -- We do not currently have auto-formatting capabilities in the Notebook. As @Joseph Kambourakis mentioned, we are working on a new IDE support capability that will enable users to re-format inside of their IDE, but that is currently in development.
We are interested in adding auto-formatting to the Notebook via a tool like black in the future, but we have no plans at this time.
01-05-2022 05:24 AM
I don't believe there is a way to do that. We do have something in development called DevBricks that will help with this kind of issue though. It's an IDE tool and it should be in preview soon. If you're interested in it talk to your CSE
01-10-2022 06:55 AM
Hi @Erik Parmann , Does @Joseph Kambourakis 's reply answer your question?
01-11-2022 02:02 AM
@Kaniz Fatma Yes:-)
01-11-2022 04:55 AM
Great!
Would you like to mark it as the best answer?
@Erik Parmann
01-10-2022 09:10 AM
Hi @Erik Parmann -- We do not currently have auto-formatting capabilities in the Notebook. As @Joseph Kambourakis mentioned, we are working on a new IDE support capability that will enable users to re-format inside of their IDE, but that is currently in development.
We are interested in adding auto-formatting to the Notebook via a tool like black in the future, but we have no plans at this time.
12-28-2023 05:49 AM
Hi Erik,
I don't know if you are aware of this feature, currently there is an option to format the code in your databricks notebooks using the black code style formatter.
Just you need to either have a version of your DBR equal to or greater than 11.2 (the libraries are configured by default) either configure the next libraries in your cluster
%pip install black==22.3.0 tokenize-rt==4.2.1
https://docs.databricks.com/en/notebooks/notebooks-code.html#format-python-cells
Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections.
Click here to register and join today!
Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.