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

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local communityโ€”sign up today to get started!

Sign Up Now