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

   ### What changes were proposed in this pull request?
   
   Adds `test_interrupt_operation_not_running` to `JobCancellationTestsMixin` 
in `python/pyspark/sql/tests/test_job_cancellation.py`. The test calls 
`SparkSession.interruptOperation` with an operation id that is not running and 
asserts that it returns an empty list. The mixin is shared, so the test runs in 
both Classic (`JobCancellationTests`) and Spark Connect 
(`JobCancellationParityTests`).
   
   ### Why are the changes needed?
   
   12 lines in `python/pyspark/sql/connect/client/core.py` were not covered by 
any test: 7 lines of `SparkConnectClient.interrupt_operation` and the 
`"operation"` branch of `_interrupt_request`. `interrupt_operation` backs the 
public `SparkSession.interruptOperation` in Spark Connect. Tests already cover 
`interruptAll` and `interruptTag`, but nothing calls `interruptOperation` in 
either mode. This test covers the full Interrupt RPC round trip for that API.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No, test-only change.
   
   ### How was this patch tested?
   
   Ran these in the PySpark CI image; all pass:
   
   ```
   python/run-tests --testnames 
'pyspark.sql.tests.connect.test_parity_job_cancellation 
JobCancellationParityTests'
   python/run-tests --testnames 'pyspark.sql.tests.test_job_cancellation 
JobCancellationTests'
   ```
   
   The new test takes about 0.01 s inside the class. `dev/lint-python` passes 
for the changed file.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Claude Opus 5.5)
   
   This pull request and its description were written by Isaac.


-- 
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