@@ -1463,8 +1463,9 @@ def preprocessing_fn(inputs):
14631463 expected_data = [{'x_scaled' : float ('nan' )}]
14641464 expected_metadata = tft .DatasetMetadata .from_feature_spec (
14651465 {'x_scaled' : tf .io .FixedLenFeature ([], tf .float32 )})
1466- with self .assertRaisesRegexp ( # pylint: disable=g-error-prone-assert-raises
1467- ValueError , 'output_min must be less than output_max' ):
1466+ with self .assertRaisesRegex ( # pylint: disable=g-error-prone-assert-raises
1467+ ValueError , 'output_min must be less than output_max'
1468+ ):
14681469 self .assertAnalyzeAndTransformResults (input_data , input_metadata ,
14691470 preprocessing_fn , expected_data ,
14701471 expected_metadata )
@@ -4656,8 +4657,9 @@ def preprocessing_fn(inputs):
46564657 preprocessing_fn , expected_outputs )
46574658
46584659 def testEmptySchema (self ):
4659- with self .assertRaisesRegexp ( # pylint: disable=g-error-prone-assert-raises
4660- ValueError , 'The input metadata is empty.' ):
4660+ with self .assertRaisesRegex ( # pylint: disable=g-error-prone-assert-raises
4661+ ValueError , 'The input metadata is empty.'
4662+ ):
46614663 self .assertAnalyzeAndTransformResults (
46624664 input_data = [{'x' : x } for x in range (5 )],
46634665 input_metadata = tft .DatasetMetadata .from_feature_spec ({}),
@@ -4785,10 +4787,12 @@ def preprocessing_fn(inputs):
47854787 preprocessing_fn , expected_outputs )
47864788
47874789 def test_preprocessing_fn_returns_wrong_type (self ):
4788- with self .assertRaisesRegexp ( # pylint: disable=g-error-prone-assert-raises
4789- ValueError , r'A `preprocessing_fn` must return a '
4790+ with self .assertRaisesRegex ( # pylint: disable=g-error-prone-assert-raises
4791+ ValueError ,
4792+ r'A `preprocessing_fn` must return a '
47904793 r'Dict\[str, Union\[tf.Tensor, tf.SparseTensor, tf.RaggedTensor\]\]. '
4791- 'Got: Tensor.*' ):
4794+ 'Got: Tensor.*' ,
4795+ ):
47924796 self .assertAnalyzeAndTransformResults (
47934797 input_data = [{'f1' : 0 }],
47944798 input_metadata = tft .DatasetMetadata .from_feature_spec (
0 commit comments