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
Valued Contributor III

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

StephanieAlba
Valued Contributor III

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