def from_feature_spec(
      cls: Type[_DatasetMetadataType],
      feature_spec: Mapping[str, common_types.FeatureSpecType],
      domains: Optional[Mapping[str, common_types.DomainType]] = None
  ) -> _DatasetMetadataType:
    """Creates a DatasetMetadata from a TF feature spec dict."""
    return cls(schema_utils.schema_from_feature_spec(feature_spec, domains))
Creates a DatasetMetadata from a TF feature spec dict.
tensorflow_transform/tf_metadata/dataset_metadata.py