gaogaotiantian commented on code in PR #59352:
URL: https://github.com/apache/spark/pull/59352#discussion_r4240536635


##########
python/pyspark/errors/tests/test_errors.py:
##########
@@ -114,6 +114,59 @@ def test_breaking_change_info(self):
         subclass_map = 
error_reader.error_info_map["TEST_ERROR_WITH_SUB_CLASS"]["sub_class"]
         self.assertEqual(breaking_change_info2, 
subclass_map["SUBCLASS"]["breaking_change_info"])
 
+    def test_message_template_sub_class_not_found(self):
+        # get_message_template raises when the main class exists but the 
sub-class does not.
+        error_reader = ErrorClassesReader()
+        error_reader.error_info_map = {
+            "TEST_ERROR": {
+                "message": ["Error message."],
+                "sub_class": {"SUBCLASS": {"message": ["Subclass message."]}},
+            },
+        }
+        with self.assertRaisesRegex(ValueError, "Cannot find sub error class 
'NON_EXISTENT_SUB'"):
+            error_reader.get_message_template("TEST_ERROR.NON_EXISTENT_SUB")
+
+    def test_breaking_change_info_lookup_errors(self):

Review Comment:
   Do we need two new methods for `breaking_change_info`? We already have a 
test and an `error_info_map` in `test_breaking_change_info`. Can we just add 
some access that raise exceptions that we need to test? We don't need these 
many methods.



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