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:ย 

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
Databricks Employee
Databricks Employee

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.

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