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 do I fix tabs vs spaces in notebooks?

StephanieAlba
Databricks Employee
Databricks Employee

I am getting

IndentationError: unindent does not match any outer indentation level

because the code I pasted has tabs that are 4 spaces, but the tabs in Databricks are 2 spaces. How do I fix this? Do I have to copy and paste it back out?

1 ACCEPTED SOLUTION

Accepted Solutions

VIPULJAINS
New Contributor III

try changing the python indentation

image

View solution in original post

3 REPLIES 3

VIPULJAINS
New Contributor III

try changing the python indentation

image

I have changed the setting to no avail 😞 However, I highlighted everything and shift+tab until it hit the left margin and then tabbed it back out. This likely worked because the issue was on the outermost indentation level. In the future, this should be better.

Zainaboladokun
New Contributor III

Nopu

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