我正在尝试一个简单的 python shell 作业,我正在尝试读取 S3 存储桶文件夹中的配置文件。Glue 服务角色具有存储桶对象读/写权限。我已经设置了 --extra-files 特殊参数以将其指向配置文件 S3 位置。
当我运行作业时,我仍然收到 FileNotFound 异常。我还使用 listdir() 查看内容并注意到配置文件丢失。
任何帮助深表感谢。谢谢
import os
import yaml
print(os.listdir("."))
file_path = "config_aws.yaml"
with open(file_path, 'r') as configfile:
config = yaml.load(configfile, Loader=yaml.FullLoader)
for section in config:
print(section)
Run Code Online (Sandbox Code Playgroud)