Skip to content

Environment variables are not passed to the py script #1

@mhasanbulli

Description

@mhasanbulli

It looks like parameters through getResolvedOptions are not accessible in the bp_sample_ps.py script. When I try to run the Glue job with the following configuration

args = getResolvedOptions(sys.argv, ["stage", "project"])
# Job input parameters
stage = args["stage"]
project = args["project"]

job fails with the following error

usage: bp_sample_ps.py [-h] --stage STAGE --project PROJECT
bp_sample_ps.py: error: the following arguments are required: --stage, --project

However, if I hard code those values like below

args = getResolvedOptions(sys.argv, ["stage", "project"])
# Job input parameters
stage = "dev"
project = "bp"

everything works just fine.

Do you have any idea why those system variables are not exposed through getResolvedOptions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions