【发布时间】:2021-05-11 06:41:24
【问题描述】:
我正在尝试使用 boto3 客户端 create_job() 创建 Glue 作业,这是脚本:
job = client.create_job(Name=xxx,
Role=xxx,
Command={
'Name': 'glueetl',
'ScriptLocation': 's3://my_bucket_name/my_project_name/src/glue.py',
'PythonVersion': '3'},
DefaultArguments={
'--job-language': 'python',
'--extra-py-files': 's3://my_bucket_name/my_project_name/src/test.zip',
'--conf': 'spark.yarn.executor.memoryOverhead=7g --conf spark.jars.packages=xxx',
},
ExecutionProperty={
'MaxConcurrentRuns': 1
},
GlueVersion='1.0'
)
test.zip 中的结构是__init__.py 文件 + 'glue.py' 文件(与ScriptLocation 中指定的文件重复)+ example.py
在“glue.py”中我有import example,然后作业失败并出现错误"ErrorMessage":"ModuleNotFoundError: No module named \'example\'"。
我试过from test import example,但没有用,我很困惑,卡在这里,Glue如何读取和导入模块?我需要设置什么吗?请问有人可以帮忙吗?非常感谢。
【问题讨论】:
标签: python amazon-web-services boto3 aws-glue import-module