suhuruli commented on code in PR #60464:
URL: https://github.com/apache/spark/pull/60464#discussion_r4609278756


##########
python/pyspark/pipelines/spark_connect_graph_element_registry.py:
##########
@@ -93,7 +93,7 @@ def register_output(self, output: Output) -> None:
         else:
             raise PySparkTypeError(
                 errorClass="UNSUPPORTED_PIPELINES_DATASET_TYPE",
-                messageParameters={"output_type": type(output).__name__},
+                messageParameters={"dataset_type": type(output).__name__},

Review Comment:
   Agreed, this branch only runs for an `Output` that is not a `Table`, 
`TemporaryView` or `Sink`, so it is not a dataset and the dataset condition was 
the wrong one. I added `UNSUPPORTED_PIPELINES_OUTPUT_TYPE` to 
`python/pyspark/errors/error-conditions.json`, with the message `Unsupported 
pipelines output type: <output_type>.`, and this raise now uses it with 
`{"output_type": type(output).__name__}`. The `Table` branch above is 
unchanged: a `Table` subclass that is neither a `MaterializedView` nor a 
`StreamingTable` is still a dataset, so it keeps 
`UNSUPPORTED_PIPELINES_DATASET_TYPE` with the `dataset_type` key. I split the 
test in `python/pyspark/pipelines/tests/test_spark_connect.py`: 
`test_register_output_unsupported_dataset_type` now covers only the `Table` 
subclass, and the new `test_register_output_unsupported_output_type` registers 
a bare `Output` and asserts the new condition, the `output_type` parameter and 
the rendered message. The static guard `test_error_classes_used_in_
 source_are_valid` still passes with the new condition.



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