Skip to content

Commit eafa03d

Browse files
committed
Internal change
PiperOrigin-RevId: 626057117
1 parent 71b4573 commit eafa03d

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

tensorflow_data_validation/anomalies/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ cc_library(
356356
deps = [
357357
":map_util",
358358
":path",
359+
"//third_party/tensorflow/tsl/platform:protobuf",
359360
"@com_github_tensorflow_metadata//tensorflow_metadata/proto/v0:metadata_v0_proto_cc_pb2",
360361
"@com_google_absl//absl/strings",
361362
"@com_google_absl//absl/types:optional",

tensorflow_data_validation/anomalies/test_util.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ limitations under the License.
1616
#include "tensorflow_data_validation/anomalies/test_util.h"
1717

1818
#include <stddef.h>
19+
1920
#include <string>
2021
#include <utility>
2122
#include <vector>
@@ -24,6 +25,7 @@ limitations under the License.
2425
#include "absl/strings/str_cat.h"
2526
#include "tensorflow_data_validation/anomalies/map_util.h"
2627
#include "tensorflow_data_validation/anomalies/path.h"
28+
#include "tensorflow/tsl/platform/protobuf.h"
2729
#include "tensorflow_metadata/proto/v0/anomalies.pb.h"
2830
#include "tensorflow_metadata/proto/v0/schema.pb.h"
2931

@@ -35,7 +37,11 @@ using std::vector;
3537
ProtoStringMatcher::ProtoStringMatcher(const string& expected)
3638
: expected_(expected) {}
3739
ProtoStringMatcher::ProtoStringMatcher(const google::protobuf::Message& expected)
38-
: expected_(expected.DebugString()) {}
40+
: expected_([&]() -> std::string {
41+
std::string result;
42+
tsl::protobuf::TextFormat::PrintToString(expected, &result);
43+
return result;
44+
}()) {}
3945

4046
void TestAnomalies(
4147
const tensorflow::metadata::v0::Anomalies& actual,

0 commit comments

Comments
 (0)