cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
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?

 

Welcome to Databricks Community: Lets learn, network and celebrate together

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.