viirya commented on code in PR #146:
URL: 
https://github.com/apache/spark-connect-rust/pull/146#discussion_r4463233964


##########
crates/pyspark-rs/src/errors.rs:
##########
@@ -75,6 +76,11 @@ pub fn spark_error_to_py_exception(err: SparkError) -> PyErr 
{
                 // This creates a PyObject exception instance
                 match exc_class.call1((msg.clone(),)) {
                     Ok(exc_instance) => {
+                        // Mirror the reference client, which stamps 
`_operation_id` on
+                        // errors raised for an ExecutePlan (read via 
`operation_id`).
+                        if let Some(op) = &operation_id {
+                            let _ = exc_instance.setattr("_operation_id", op);

Review Comment:
   Covered in 76c1d5c with the same mock ExecutePlan. The server echoes the 
request's operation id, as a real server does.
   - `test_execute_plan_error_carries_operation_id` makes ExecutePlan fail and 
checks that the raised `PySparkException.operation_id` equals the request's id.
   - `test_execution_info_decodes_observed_metrics_and_operation_id` checks 
`executionInfo.operation_id` and the decoded flows after a real action.
   



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