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: 

AttributeError: 'list' object has no attribute 'columns' - PySpark

db-avengers2rul
Contributor II

Hi All,

i am getting the below error when i am ingesting the data from source file , source file is also attached , i have tried in both Community edition and Azure databricks as well getting the same error , can any one suggest me the solution ?

 # reading a df for orders
orders_df = spark.read.json("/public/retail_db_json/orders").dtypes
 
# displaying the columns 
orders_df.columns
 
# Error
AttributeError: 'list' object has no attribute 'columns'
 

Regards,

Rakesh

0 REPLIES 0

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