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: 

Default indentation for Python has changed after migration to the new workspace

Direo
Contributor

In our old workspace default identation was 2 spaces. In our new one it has changed to 4 spaces.

Of course you can manually change it back to 2 spaces as we used to have, but it does not work.

Does anyone know how to solve this issue?

3 REPLIES 3

Direo
Contributor

Found one solution. To change identation in every single old notebook which you gonna chnage by selecting edit-> set Python identation.

Still would be nice to make this change for all notebooks at once.

Prabakar
Databricks Employee
Databricks Employee

setting it for all notebooks won't be possible as the setting is notebook level. Users might have python/scala/sql/R notebook. So if this has to be set for all notebooks then other notebooks might be affected and would end up in error. So having these settings to notebook level is better.

ranged_coop
Valued Contributor II

You do have that option of Settings --> User Settings (Admin Settings ? not sure - I don't have admin access) --> Notebook Settings --> Default indentation for Python cells (in spaces)

This will change the indentation for newer cells, but existing ones, I am not sure.

Maybe someone from databricks can confirm...

On the other hand if it does change, it will be pain considering it will show up as a change in git history and we will have to push everything again ? Not sure...

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