suhuruli opened a new pull request, #60655:
URL: https://github.com/apache/spark/pull/60655

   ### What changes were proposed in this pull request?
   
   Fix the conflicting-option name in the error raised by `spark-pipelines run` 
when `--full-refresh-all` is combined with `--full-refresh`. The message 
currently reports the conflicting option as `--full_refresh` (underscore). The 
CLI only defines `--full-refresh` (hyphen), so the message names a flag that 
does not exist. This changes the `conflicting_option` message parameter in 
`python/pyspark/pipelines/cli.py` from `--full_refresh` to `--full-refresh` and 
updates the unit test that asserts the parameter value.
   
   The sibling check for `--full-refresh-all` combined with `--refresh` already 
reports `--refresh` and is unchanged.
   
   ### Why are the changes needed?
   
   Users who pass both flags see:
   
   ```
   [CONFLICTING_PIPELINE_REFRESH_OPTIONS] --full-refresh-all option conflicts 
with --full_refresh
   The --full-refresh-all option performs a full refresh of all datasets,
   so specifying individual datasets with --full_refresh is not allowed.
   ```
   
   `--full_refresh` is not an option the CLI accepts. Passing it gives `error: 
unrecognized arguments: --full_refresh`, and `spark-pipelines run --help` lists 
`--full-refresh`. So the message points at something the user cannot have 
typed. The underscore spelling comes from the Python parameter name 
`full_refresh` in `run()`, not from the command line flag. The message should 
name the flag as the user typed it.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes, the text of one error message changes. Before:
   
   ```
   [CONFLICTING_PIPELINE_REFRESH_OPTIONS] --full-refresh-all option conflicts 
with --full_refresh
   ```
   
   After:
   
   ```
   [CONFLICTING_PIPELINE_REFRESH_OPTIONS] --full-refresh-all option conflicts 
with --full-refresh
   ```
   
   The error condition and the message parameter key are unchanged.
   
   ### How was this patch tested?
   
   Updated `test_full_refresh_all_conflicts_with_full_refresh` in 
`python/pyspark/pipelines/tests/test_cli.py` to expect `--full-refresh`. The 
updated assertion fails without the fix (`{'conflicting_option': 
'--full_refresh'} != {'conflicting_option': '--full-refresh'}`) and passes with 
it. I ran the pipelines CLI test module against a local `build/sbt -Phive 
package` build; all 25 tests pass:
   
   ```
   python/run-tests --testnames pyspark.pipelines.tests.test_cli
   ```
   
   I also reproduced it end to end with a minimal spec:
   
   ```
   bin/spark-pipelines run --spec spark-pipeline.yaml --full-refresh-all 
--full-refresh t1
   ```
   
   which now prints `--full-refresh-all option conflicts with --full-refresh`. 
`ruff check` and `ruff format --check` pass on the touched files.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Opus 5.5
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to