-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix incorrect processing of short flags for user tools cli #677
Conversation
Signed-off-by: Partho Sarthi <[email protected]>
Signed-off-by: Partho Sarthi <[email protected]>
Signed-off-by: Partho Sarthi <[email protected]>
LGTM in general. Could you please post the results when using short flags for user-tools cli. I am not certain if we have any tests to process arguments. |
Signed-off-by: Partho Sarthi <[email protected]>
Thanks @nartal1. Adding sample input and output here: Input/Output
|
Signed-off-by: Partho Sarthi <[email protected]>
Signed-off-by: Partho Sarthi <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested this PR with combination of short flags and arg values for both spark_rapids_user_tools and spark_rapids cli. LGTM. Thanks @parthosa !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix @parthosa! LGTM.
Fixes #671. This PR fixes the bug due to incorrect handling of short flag arguments and keyword arguments in the fire library (#671 (comment)).
The problem occurs because the short flag arguments gets stored in the keyword argument dictionary (
rapids_options
in our case). The current resolution involves retrieving the value from this dictionary.Design
rapids_options
dictionary, else return the default value.fire
generates help text from the function documentation, executing the pre-processing function first would impact the generation of help text.Code Changes
get_value_or_pop()
to get the correct value of argument based on#1
.qualification()
andprofiling()
method.bootstrap()
anddiagnostic()
do not need this change because they do not haverapids_option
argument and hence short flag arguments are processed correctly.User Facing Changes
User Tools Short Flag Argument List
spark_rapids_user_tools CLI:
-
denotes argument does not exist for the given tool and CSP.Conflict
denotes short flag is not possible due to conflict with other argumentNew CLI: