code: def test_infer_feature_schema_with_ragged_tensor(self, use_compat_v1):
      if not use_compat_v1:
          test_case.skip_if_not_tf2("Tensorflow 2.x required")
  
      def preprocessing_fn(_):
          return {
              "foo": tf.RaggedTensor.from_row_splits(
                  values=tf.constant(
                      [3, 1, 4, 1, 5, 9, 2, 6], tf.int64
                  ),
                  row_splits=[0, 4, 4, 7, 8, 8],
              ),
              "bar": tf.RaggedTensor.from_row_splits(
                  values=tf.RaggedTensor.from_row_splits(
                      values=tf.ones([5], tf.float32),
                      row_splits=[0, 2, 3, 5],
                  ),
                  row_splits=[0, 0, 0, 2, 2, 4],
              ),
              "baz": tf.RaggedTensor.from_row_splits(
                  values=tf.ones([5, 3], tf.float32),
                  row_splits=[0, 2, 3, 5],
              ),
              "qux": tf.RaggedTensor.from_row_splits(
                  values=tf.RaggedTensor.from_row_splits(
                      values=tf.ones([5, 7], tf.float32),
                      row_splits=[0, 2, 3, 5],
                  ),
                  row_splits=[0, 0, 0, 2, 2, 4],
              ),
          }
  
      schema = self._get_schema(
          preprocessing_fn, use_compat_v1, create_session=True
      )
      expected_schema_ascii = """
        feature {
          name: "bar$ragged_values"
          type: FLOAT
        }
        feature {
          name: "bar$row_lengths_1"
          type: INT
        }
        feature {
          name: "baz$ragged_values"
          type: FLOAT
        }
        feature {
          name: "foo$ragged_values"
          type: INT
        }
        feature {
          name: "qux$ragged_values"
          type: FLOAT
        }
        feature {
          name: "qux$row_lengths_1"
          type: INT
        }
        tensor_representation_group {
          key: ""
          value {
            tensor_representation {
              key: "foo"
              value {
                ragged_tensor {
                  feature_path { step: "foo$ragged_values" }
                }
              }
            }
            tensor_representation {
              key: "bar"
              value {
                ragged_tensor {
                  feature_path { step: "bar$ragged_values" }
                  partition { row_length: "bar$row_lengths_1"}
                }
              }
            }
            tensor_representation {
              key: "baz"
              value {
                ragged_tensor {
                  feature_path { step: "baz$ragged_values" }
                  partition { uniform_row_length: 3}
                }
              }
            }
            tensor_representation {
              key: "qux"
              value {
                ragged_tensor {
                  feature_path { step: "qux$ragged_values" }
                  partition { row_length: "qux$row_lengths_1"}
                  partition { uniform_row_length: 7}
                }
              }
            }
          }
        }
        """
      expected_schema = text_format.Parse(
          expected_schema_ascii, schema_pb2.Schema()
      )
      schema_utils_legacy.set_generate_legacy_feature_spec(
          expected_schema, False
      )
      self.assertProtoEquals(expected_schema, schema)
  
imports: import functools
  import os
  import tensorflow
  from tensorflow_transform import analyzers
  from tensorflow_transform import common
  from tensorflow_transform import graph_context
  from tensorflow_transform import mappers
  from tensorflow_transform import schema_inference
  from tensorflow_transform import tf2_utils
  from tensorflow_transform import test_case
  from tensorflow_transform.tf_metadata import schema_utils_legacy
  from tensorflow_transform.tf_metadata import schema_utils
  from google.protobuf import text_format
  import unittest
  from tensorflow_metadata.proto.v0 import schema_pb2
label_desc: Use image node_id 7 for calling the SchemaInferenceTest obj's underlying member method code with example usage: obj.test_infer_feature_schema_with_ragged_tensor(use_compat_v1) and returns: dict