Anonymous
Not applicable

Hi @Yuanyue Liu​ ,

The spark engine is connected to the (remote) workers on Databricks, this is the reason why you can read the data from the dbfs by use of:

spark.read.format('csv').options(header='true').load('path/in/the/remote/dbfs/filesystem/')

The same happens with dbutils, for example. You can read files in the dbfs with for example:

dbutils.fs.ls(files_path)

Pandas does not connect directly to the remote filesystem (dbfs). That is the reason why you have to first read the remote data with spark and then transform to an in-memory dataframe (pandas).

I am using pandas profiling and after I make an HTML report, which is written to the local driver (since pandas_profiling does not connect to the remote filesystem either), I use dbutils to upload data to my mnt drive in dbfs (that comes from a datalake gen2).

I hope this helps!