@@ -806,7 +806,7 @@ def test_agg_query_dq_detailed_result_exception_v2(_fixture_df, _query_dq_rule_e
806806 _fixture_df .createOrReplaceTempView ("query_test_table_target" )
807807 with pytest .raises (
808808 SparkExpectationsMiscException ,
809- match = r"(error occurred while running agg_query_dq_detailed_result Sql query is invalid. *)|(error occurred while running agg_query_dq_detailed_result Regex match not found. *)" ,
809+ match = r"(error occurred while running agg_query_dq_detailed_result: Sql query is invalid. *)|(error occurred while running agg_query_dq_detailed_result: Regex match not found. *)" ,
810810 ):
811811 SparkExpectationsActions ().agg_query_dq_detailed_result (
812812 _fixture_mock_context , _query_dq_rule_exception , _fixture_df , []
@@ -1028,7 +1028,7 @@ def test_run_dq_rules_query(
10281028def test_run_dq_rules_negative_case (_fixture_df , _fixture_mock_context ):
10291029 expectations = {"row_dq_rules" : []}
10301030
1031- with pytest .raises (SparkExpectationsMiscException , match = r"error occurred while running expectations .*" ):
1031+ with pytest .raises (SparkExpectationsMiscException , match = r"error occurred while running expectations: .*" ):
10321032 SparkExpectationsActions .run_dq_rules (_fixture_mock_context , _fixture_df , expectations , "row_dq" )
10331033
10341034@pytest .mark .parametrize (
@@ -1054,7 +1054,7 @@ def test_run_dq_rules_negative_case(_fixture_df, _fixture_mock_context):
10541054)
10551055def test_run_dq_rules_exception (_fixture_df , _fixture_mock_context , expectations , expected_exception ):
10561056 # test the exception functionality in run_dq_rules with faulty user input
1057- with pytest .raises (expected_exception , match = r"error occurred while running expectations .*" ):
1057+ with pytest .raises (expected_exception , match = r"error occurred while running expectations: .*" ):
10581058 SparkExpectationsActions .run_dq_rules (_fixture_mock_context , _fixture_df , expectations , "row_dq" )
10591059
10601060
@@ -1080,7 +1080,7 @@ def test_run_dq_rules_condition_expression_exception(
10801080 }
10811081 _fixture_df .createOrReplaceTempView ("query_test_table" )
10821082
1083- with pytest .raises (SparkExpectationsMiscException , match = r"error occurred while running expectations .*" ):
1083+ with pytest .raises (SparkExpectationsMiscException , match = r"error occurred while running expectations: .*" ):
10841084 SparkExpectationsActions .run_dq_rules (
10851085 _fixture_mock_context , _fixture_df , _expectations , "query_dq" , False , True
10861086 )
@@ -1113,7 +1113,7 @@ def test_run_dq_rules_condition_expression_dynamic_exception(
11131113 }
11141114 _fixture_df .createOrReplaceTempView ("query_test_table" )
11151115
1116- with pytest .raises (SparkExpectationsMiscException , match = r"error occurred while running expectations .*" ):
1116+ with pytest .raises (SparkExpectationsMiscException , match = r"error occurred while running expectations: .*" ):
11171117 _rule_type = _rule_test .get ("rule_type" )
11181118 SparkExpectationsActions .run_dq_rules (
11191119 _fixture_mock_context , _fixture_df , _expectations , _rule_type , False , True
@@ -1129,7 +1129,7 @@ def collect(self):
11291129 return [[["unexpected" , "list" ]]] # Not int, float, str, or date
11301130 return DummyRow ()
11311131 dummy_df = DummyDF ()
1132- with pytest .raises (SparkExpectationsMiscException , match = "error occurred while running agg_query_dq_detailed_result .*" ):
1132+ with pytest .raises (SparkExpectationsMiscException , match = "error occurred while running agg_query_dq_detailed_result: .*" ):
11331133 SparkExpectationsActions .agg_query_dq_detailed_result (
11341134 _fixture_mock_context , _fixture_agg_dq_rule , dummy_df , []
11351135 )
@@ -1215,7 +1215,7 @@ def test_create_agg_dq_results(input_df, rule_type_name, expected_output, _fixtu
12151215)
12161216def test_create_agg_dq_results_exception (input_df , _fixture_mock_context ):
12171217 # faulty user input is given to test the exception functionality of the agg_dq_result
1218- with pytest .raises (SparkExpectationsMiscException , match = r"error occurred while running create agg dq results .*" ):
1218+ with pytest .raises (SparkExpectationsMiscException , match = r"error occurred while running create_agg_dq_results: .*" ):
12191219 SparkExpectationsActions ().create_agg_dq_results (
12201220 _fixture_mock_context ,
12211221 input_df ,
@@ -1961,7 +1961,7 @@ def test_agg_query_dq_detailed_result_type_error_line_210(_fixture_agg_dq_rule,
19611961 mock_result = Mock ()
19621962 mock_result .collect .return_value = [[[]]] # Return list to trigger TypeError
19631963 mock_agg .return_value = mock_result
1964- with pytest .raises (SparkExpectationsMiscException , match = "error occurred while running agg_query_dq_detailed_result .*" ):
1964+ with pytest .raises (SparkExpectationsMiscException , match = "error occurred while running agg_query_dq_detailed_result: .*" ):
19651965 SparkExpectationsActions .agg_query_dq_detailed_result (
19661966 _fixture_mock_context , _fixture_agg_dq_rule , df , []
19671967 )
0 commit comments