简体   繁体   中英

Pass Dynamic Parameters to AWS Glue

I am trying to pass dynamic parameters to a glue job. I followed this question: AWS Glue Job Input Parameters

And configured my parameters like so:

在此处输入图像描述

I'm triggering the glue job with boto3 with the following code:

event = {
    '--ncoa': "True", 
    '--files': 'file.csv', 
    '--group_file': '3e93475d45b4ebecc9a09533ce57b1e7.csv', 
    '--client_slug': 'test', 
    '--slm_id': '12345'
}

glueClient.start_job_run(JobName='TriggerNCOA', Arguments=event)

and when I run this glue code:

args = getResolvedOptions(sys.argv, ['NCOA','Files','GroupFile','ClientSlug', 'SLMID'])

v_list=[{"ncoa":args['NCOA'],"files":args['Files'],"group_file":args['GroupFile'], "client_slug":args['ClientSlug'], "slm_id":args['SLMID']}]

print(v_list)

It just gives me 'a' for every value, not the values of the original event that I passed in from boto3. how do I fix that? Seems like im missing something very slight, but ive looked around and haven't found anything conclusive.

You are using CamelCase and Capital letters into Glue Job Parameters, but you are using small letters in python code to override the Parameters.

Ex.

The key of the job parameter in Glue is --ClientSlug but the key for Argument set in python code is --client_slug

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