Skip to content
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

Follow Up: Make '--platform' argument mandatory in CLI #1473

Merged
merged 2 commits into from
Dec 20, 2024

Conversation

parthosa
Copy link
Collaborator

Fixes #1472.

This PR ensures that the --help output for the CLI command reflects the --platform parameter as mandatory.

Current Behavior

Running the command spark_rapids qualification -- --help incorrectly shows the platform argument as optional:

 -p, --platform=PLATFORM
        Type: Optional[str]
        Default: None
        defines one of the following "onprem", "emr", "dataproc", "dataproc-gke", "databricks-aws", and "databricks-azure".

After this PR

    -p, --platform=PLATFORM (required)
        Type: str
        Defines one of the following: "onprem", "emr", "dataproc", "dataproc-gke", "databricks-aws", and "databricks-azure".

@parthosa parthosa added the bug Something isn't working label Dec 19, 2024
@parthosa parthosa requested a review from amahussein December 19, 2024 18:55
@parthosa parthosa self-assigned this Dec 19, 2024
Signed-off-by: Partho Sarthi <[email protected]>
@parthosa parthosa marked this pull request as ready for review December 19, 2024 20:28
Copy link
Collaborator

@amahussein amahussein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @parthosa
LGTME

@parthosa parthosa merged commit f0058c0 into NVIDIA:dev Dec 20, 2024
15 checks passed
@parthosa parthosa deleted the spark-rapids-tools-1472 branch December 20, 2024 17:48
parthosa added a commit to parthosa/spark-rapids-tools that referenced this pull request Jan 10, 2025
parthosa added a commit that referenced this pull request Jan 21, 2025
…" (#1498)

Fixes #1497. 

In #1472, the
`--platform` argument was made a required parameter in Fire. In our
tests, it was found that the short flag -p for platform is no longer
functioning.

Upon investigation, it seems that Fire does not support short flags for
required arguments.

This PR reverts the above commit and makes the platform argument
optional in Fire. This change will ensure compatibility with the -p
flag.

The platform argument will still be validated internally to ensure its
requirement is enforced.


### Case 1 : Platform not provided

```
spark_rapids qualification  --eventlogs "/path/to/dataproc-cpu" --verbose
```

#### STDOUT

```

2025-01-10 13:35:16,011 INFO spark_rapids_tools.argparser: ...applying argument case: Missing Platform argument
2025-01-10 13:35:16,012 ERROR spark_rapids_tools.argparser: Validation err: 1 validation error for QualifyUserArgModel
  Cannot run tool cmd without platform argument. Re-run the command providing the platform argument.
  Error: [type=invalid_argument, input_value=ArgsKwargs((), {'eventlog...ols_config_path': None}), input_type=ArgsKwargs]
```



### Case 2: Platform provided by `--platform` and `-p`

```
spark_rapids qualification --platform dataproc --eventlogs "/path/to/dataproc-cpu" --verbose
spark_rapids qualification -p dataproc --eventlogs "/path/to/dataproc-cpu" --verbose
```


#### STDOUT
```
Report Summary:
----------------------  -
Total applications      1
Processed applications  1
Top candidates          0
----------------------  -


Processing Completed!
```

---------

Signed-off-by: Partho Sarthi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Followup: Make '--platform' argument mandatory in CLI to prevent incorrect behavior
2 participants