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:ย 

Problems with pandas.read_parquet() and path

johnb1
Contributor

I am doing the "Data Engineering with Databricks V2" learning path.

I cannot run "DE 4.2 - Providing Options for External Sources", as the first code cell does not run successful:

%run ../Includes/Classroom-Setup-04.2

Screenshot 1:

MicrosoftTeams-image 

Inside the setup notebook, the code crashes at the following command (see screenshot 2):

df = pd.read_parquet(path = datasource_path.replace("dbfs:/", '/dbfs/'))

The error message is:

FileNotFoundError: [Errno 2] No such file or directory: '/dbfs/mnt/dbacademy-datasets/data-engineering-with-databricks/v02/ecommerce/raw/users-historical'

Screenshot 2:

MicrosoftTeams-image (1) 

There seems to be an issue with the path, even though it actually exists:

Screenshot 3:

Capture 

I played around a little with the path specification, but nothing helped:

Screenshot 4:

Capture_2 

16 REPLIES 16

vigneshmayil
New Contributor II

spark solution worked

instead of 

df = pd.read_parquet(path = datasource_path.replace("dbfs:/", '/dbfs/'))
 
I used 

spark_df = spark.read.parquet("dbfs:/mnt/dbacademy-datasets/data-engineer-learning-path/v04/ecommerce/raw/users-historical/")
# Convert to pandas
DataFrame
df = spark_df.toPandas()

hebied
New Contributor II

Thanks for sharing bro ..It really helped.

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