def METHOD_NAME(self):
    inputs = tf.constant([0, 1, 2])
    with self.assertRaisesRegex(ValueError, "idf_weights must be provided"):
        preprocessing_utils.encode_categorical_inputs(
            inputs, "tf_idf", 4, "float32"
        )