AWS胶 - 阅读a' local'在Python中归档
在AWS胶水中,我使用了一个旧版Python软件包,该软件包从同一软件包中读取恒定的JSON文件。要简化事情,假设testlib
软件包具有test_lib.py
和data.json
文件。 test_lib.py
具有一个函数:
def test():
f = open('data.json')
我将testlib.zip上传到s3并在AWS胶合作业中使用它:
from test_lib import test
test()
AWS胶合作业失败,错误:filenotfounderror:[errno 2]没有这样文件或目录:'data.json'
关于如何在AWS胶水中管理S3上的文件有很多问题。但这需要更改我不想做的旧软件包。
有什么方法可以配置AWS胶合作业以允许打开“本地”文件?
In AWS Glue I use a legacy Python package that reads a constant json file from the same package. To simplify things, let's say testLib
package has a test_lib.py
and data.json
files. test_lib.py
has a function:
def test():
f = open('data.json')
I uploaded testLib.zip to S3 and use it in the AWS Glue job:
from test_lib import test
test()
The AWS Glue job fails with the error: FileNotFoundError: [Errno 2] No such file or directory: 'data.json'
There are many questions about how to manage files on S3 in AWS Glue. But it requires changing the legacy package that I don't want to do.
Is there any way to configure AWS Glue job to allow open 'local' files?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论