Disable argparse's allow_abbrev Functionality to Make getResolvedOptions Behavior Consistent #206
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue # (N/A)
This change is to address a flaw within the
getResolvedOptions()
function. This function uses theparse_known_args
function of the python repo packageargparse
to resolve arguments to Glue. If a Glue Job has the two arguments--metadata
and--metadata_location
, when a user runs this function with the option map containing just["metadata_location"]
the resulting behavior out of glue is unpredictable as theparse_known_args
function here has a side effect listed in it's source. This side effect causes the wrong argument values to be passed from this function to a user.Description of changes:
As an example: this is a sample of this behavior from my job.
Below is psuedo of the offending production code:
The solution provided by this PR disables
allow_abbrev
and requires a user to exactly match the string argument they're trying to extract, which seems to be the intended behavior based on documentation.Thanks for reading.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.