简体   繁体   中英

pyspark : Configparser is not reading config file from google storage

I am trying to read a config file from google storage bucket via pyspark script run by dataproc. But the file is not read.

config = configparser.ConfigParser()
config.read('gs://<<google_bucket_location>>/example.ini')
[]

Notice that configparser reads only local files. The best option is to download the config file from GCS into a tmp directory and read it form there.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM