如何为 AWS Glue 作业实施可选参数?
我创建了一个当前具有字符串参数(ISO 8601 日期字符串)作为 ETL 作业中使用的输入的作业。我想将此参数设为可选,以便作业在未提供时使用默认值(例如,在我的情况下使用datetime.now和datetime.isoformat)。我曾尝试使用getResolvedOptions:
import sys
from awsglue.utils import getResolvedOptions
args = getResolvedOptions(sys.argv, ['ISO_8601_STRING'])
但是,当我没有传递--ISO_8601_STRING作业参数时,我看到以下错误:
awsglue.utils.GlueArgumentError:需要参数 --ISO_8601_STRING
蓝山帝景
墨色风雨
梵蒂冈之花
相关分类