anxkhn commented on code in PR #57005:
URL: https://github.com/apache/spark/pull/57005#discussion_r3593027380


##########
python/pyspark/pipelines/tests/test_spark_connect.py:
##########
@@ -90,6 +93,20 @@ def st():
             "INVALID_FLOW_QUERY_TYPE.BATCH_RELATION_FOR_STREAMING_TABLE", 
str(context.exception)
         )
 
+    def test_register_output_unsupported_dataset_type(self):
+        registry = SparkConnectGraphElementRegistry(self.spark, 
"test_dataflow_graph_id")
+
+        unsupported_output = Output(
+            name="unsupported",
+            comment=None,
+            source_code_location=SourceCodeLocation(filename="test.py", 
line_number=1),
+        )
+        with self.assertRaises(PySparkTypeError) as context:
+            registry.register_output(unsupported_output)
+
+        self.assertEqual(context.exception.getCondition(), 
"UNSUPPORTED_PIPELINES_DATASET_TYPE")
+        self.assertEqual(context.exception.getMessageParameters(), 
{"dataset_type": "Output"})
+

Review Comment:
   Added a CustomTable case, so the regression test now covers both raise sites.



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