uros-b commented on code in PR #57005:
URL: https://github.com/apache/spark/pull/57005#discussion_r3524957814


##########
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:
   The regression test exercises only the second (outer else) raise site via a 
bare Output(). The first raise site (inside if isinstance(output, Table):, a 
Table subclass that is neither MaterializedView nor StreamingTable) carries the 
identical bug+fix but is untested; a class CustomTable(Table) assertion would 
close the gap and guard against a future regression on that branch.



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