cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

How to change the width of the lines for Python Format in a notebook?

MichaelN1
New Contributor II

Hi

does anyone know how to change the default 80 symbols for the line length when executing "Format Python Code" in Databricks notebook?

These days ultra wide monitors are new standards and having 80 line width with breaks to a new line is not usable

6 REPLIES 6

Hubert-Dudek
Esteemed Contributor III

Sadly editor options are only ones in user settings, and nothing is related to that. 80 symbols are related to code readability, not to screen size.

You can send feedback related to the new editor on that link https://databricks.sjc1.qualtrics.com/jfe/form/SV_3wpuprPLlFkVMP4

Look also to pep eight it says:

"Maximum Line Length

Limit all lines to a maximum of 79 characters.

For flowing long blocks of text with fewer structural restrictions (docstrings or comments), the line length should be limited to 72 characters.

Limiting the required editor window width makes it possible to have several files open side by side, and works well when using code review tools that present the two versions in adjacent columns.

The default wrapping in most tools disrupts the visual structure of the code, making it more difficult to understand. The limits are chosen to avoid wrapping in editors with the window width set to 80, even if the tool places a marker glyph in the final column when wrapping lines. Some web based tools may not offer dynamic line wrapping at all.

Some teams strongly prefer a longer line length. For code maintained exclusively or primarily by a team that can reach agreement on this issue, it is okay to increase the line length limit up to 99 characters, provided that comments and docstrings are still wrapped at 72 characters.

The Python standard library is conservative and requires limiting lines to 79 characters (and docstrings/comments to 72)."

Meghala
Valued Contributor II

It's was helpful​

Manoj12421
Valued Contributor II

It was helpful ​

MichaelN1
New Contributor II

thanks for the answer. I strongly believe it should be customizable to let users decide their preferences.

There are cases where someone would prefer code to be in 1 line rather than 6 lines.

I've sent the feedback to the team

youssefmrini
Honored Contributor III
Honored Contributor III

I don't think you can change it but i recommend you share your feedback in the survey posted by @Hubert Dudek​ 

Rajeev_Basu
Contributor III

It may not be possible presently. but would be good to be recommended to Databricks as a feedback.

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.