cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

A problem with formating python code to pep8

bstanie
New Contributor

Hi there,

Anyone here experienced any problems with formatiing python code inside databricks notebook cells? I'm constantly having this weird problem, both with very short/simple and complex code, in different notebooks. Sometimes it somehow works, and I can't find a root cause for this bug.

I'm attaching an error message that I'm getting when trying to format the code. Any help is appreciated. Currently I'm forced to pull code to my local machine, format it in PyCharm and push back to databricks

1 REPLY 1

-werners-
Esteemed Contributor III

that is interesting.
Can you check if you you use a version > 11.2.  If not you have to install black and tokenize-rt.
Can you check if you use a custom pyproject.toml file?  It might be related to that.
(You also need edit permission on the notebook but I assume that is not the issue here).

The error seems to be about some malformed/missing config.  Did you define external config somewhere?

 

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group