Read file from dbfs with pd.read_csv() using databricks-connect

hamzatazib96
Databricks Partner

Hello all,

As described in the title, here's my problem:

1. I'm using databricks-connect in order to send jobs to a databricks cluster

2. The "local" environment is an AWS EC2

3. I want to read a CSV file that is in DBFS (databricks) with

pd.read_csv()
. Reason for that is that it's too big to do
spark.read.csv()
and then
.toPandas()
(crashes everytime).

4. When I run

pd.read_csv("/dbfs/FileStore/some_file")
I get a
FileNotFoundError
because it points to the local S3 buckets rather than to dbfs. Is there a way to do what I want to do (e.g. change where pandas looks for files with some options)?

Thanks a lot in advance!