[Python] Why does Python Glue Job throw a KeyError for my Job parameter?

Discussão em 'Python' iniciado por Stack, Novembro 29, 2024.

  1. Stack

    Stack Membro Participativo

    I have defined a simple Glue Job of type Python Shell:

    import sys
    from awsglue.utils import getResolvedOptions

    args = getResolvedOptions(sys.argv, [
    'test-parameter'
    ])

    value = args["test-parameter"]
    print(f'value = {value}')


    I am trying to pass the following Job parameter:

    • Key: --test-parameter
    • Value: hello world

    When I run this Glue Job, I get the following error:


    KeyError: 'test-parameter'
    ​

    How can I fix this problem?

    Continue reading...

Compartilhe esta Página