Skip to content

Commit 69c58c2

Browse files
committed
add import for re2.BUILD remove tfx_bsl sql_util dependencies
1 parent d6156ad commit 69c58c2

4 files changed

Lines changed: 12 additions & 44 deletions

File tree

WORKSPACE

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,16 @@ http_archive(
100100
url = "https://github.com/abseil/abseil-cpp/archive/%s.tar.gz" % COM_GOOGLE_ABSL_COMMIT,
101101
)
102102

103+
104+
# re2 required for google tests
105+
http_archive(
106+
name = "com_googlesource_code_re2",
107+
# build_file = "//third_party:re2.BUILD",
108+
sha256 = "b90430b2a9240df4459108b3e291be80ae92c68a47bc06ef2dc419c5724de061",
109+
strip_prefix = "re2-a276a8c738735a0fe45a6ee590fe2df69bcf4502",
110+
urls = ["https://github.com/google/re2/archive/a276a8c738735a0fe45a6ee590fe2df69bcf4502.tar.gz"],
111+
)
112+
103113
# Will be loaded by workspace.bzl from head
104114
# TFMD_COMMIT = "404805761e614561cceedc429e67c357c62be26d" # 1.17.1
105115

tensorflow_data_validation/anomalies/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,6 @@ cc_library(
435435
":status_util",
436436
"//tensorflow_data_validation/anomalies/proto:custom_validation_config_proto_cc_pb2",
437437
"@com_github_tensorflow_metadata//tensorflow_metadata/proto/v0:metadata_v0_proto_cc_pb2",
438-
"@com_github_tfx_bsl//tfx_bsl/cc/statistics:sql_util",
439438
"@com_google_absl//absl/base:log_severity",
440439
"@com_google_absl//absl/container:flat_hash_map",
441440
"@com_google_absl//absl/log",

tensorflow_data_validation/anomalies/custom_validation.cc

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ limitations under the License.
2222
#include "tensorflow_data_validation/anomalies/path.h"
2323
#include "tensorflow_data_validation/anomalies/schema_util.h"
2424
#include "tensorflow_data_validation/anomalies/status_util.h"
25-
#include "tfx_bsl/cc/statistics/sql_util.h"
2625
#include "tensorflow_metadata/proto/v0/anomalies.pb.h"
2726
#include "tensorflow_metadata/proto/v0/path.pb.h"
2827
#include "tensorflow_metadata/proto/v0/statistics.pb.h"
@@ -193,24 +192,6 @@ absl::Status CustomValidateStatistics(
193192
TFDV_RETURN_IF_ERROR(GetFeatureStatistics(
194193
named_test_statistics, feature_validation.dataset_name(),
195194
feature_validation.feature_path(), &test_statistics));
196-
for (const auto& validation : feature_validation.validations()) {
197-
if (InCurrentEnvironment(validation, environment)) {
198-
absl::StatusOr<bool> query_result =
199-
tfx_bsl::statistics::EvaluatePredicate(test_statistics,
200-
validation.sql_expression());
201-
if (!query_result.ok()) {
202-
return absl::InternalError(absl::StrCat(
203-
"Attempt to run query '", validation.sql_expression(),
204-
"' failed with error: ", query_result.status().ToString()));
205-
} else if (!query_result.value()) {
206-
// If the sql_expression evaluates to False, there is an anomaly.
207-
TFDV_RETURN_IF_ERROR(UpdateAnomalyResults(
208-
feature_validation.feature_path(),
209-
feature_validation.dataset_name(), absl::nullopt, absl::nullopt,
210-
validation, result));
211-
}
212-
}
213-
}
214195
}
215196
if (validations.feature_pair_validations_size() > 0) {
216197
if (base_statistics == nullptr) {
@@ -231,28 +212,6 @@ absl::Status CustomValidateStatistics(
231212
TFDV_RETURN_IF_ERROR(GetFeatureStatistics(
232213
named_base_statistics, feature_pair_validation.base_dataset_name(),
233214
feature_pair_validation.feature_base_path(), &base_statistics));
234-
for (const auto& validation : feature_pair_validation.validations()) {
235-
if (InCurrentEnvironment(validation, environment)) {
236-
absl::StatusOr<bool> query_result =
237-
tfx_bsl::statistics::EvaluatePredicate(
238-
base_statistics, test_statistics,
239-
validation.sql_expression());
240-
if (!query_result.ok()) {
241-
return absl::InternalError(absl::StrCat(
242-
"Attempt to run query: ", validation.sql_expression(),
243-
" failed with the following error: ",
244-
query_result.status().ToString()));
245-
} else if (!query_result.value()) {
246-
// If the sql_expression evaluates to False, there is an anomaly.
247-
TFDV_RETURN_IF_ERROR(UpdateAnomalyResults(
248-
feature_pair_validation.feature_test_path(),
249-
feature_pair_validation.dataset_name(),
250-
feature_pair_validation.base_dataset_name(),
251-
feature_pair_validation.feature_base_path(), validation,
252-
result));
253-
}
254-
}
255-
}
256215
}
257216
}
258217
return absl::OkStatus();

tensorflow_data_validation/workspace.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ def tf_data_validation_workspace():
1414

1515
git_repository(
1616
name = "com_github_tfx_bsl",
17-
branch = "master",
18-
remote = "https://github.com/tensorflow/tfx-bsl",
17+
branch = "m1_build",
18+
remote = "https://github.com/andrewfulton9/tfx-bsl",
1919
)

0 commit comments

Comments
 (0)