Skip to content

Commit e83cbfd

Browse files
committed
dont run xfail + add test deps
1 parent 94c6af2 commit e83cbfd

19 files changed

+101
-96
lines changed

.github/reusable-build/action.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ runs:
1616
with:
1717
python-version: ${{ inputs.python-version }}
1818

19-
- name: Upgrade pip
20-
shell: bash
21-
run: |
22-
python -m pip install --upgrade pip pytest
23-
2419
- name: Build the package for Python ${{ inputs.python-version }}
2520
shell: bash
2621
run: |

pyproject.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,13 @@ requires = [
1919
# Required for using org_tensorflow bazel repository.
2020
"numpy~=1.22.0",
2121
]
22+
23+
[project]
24+
name = "tensorflow-data-validation"
25+
26+
[project.optional-dependencies]
27+
test = [
28+
"pytest",
29+
"scikit-learn",
30+
"scipy",
31+
]

tensorflow_data_validation/api/stats_api_test.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class StatsAPITest(absltest.TestCase):
4444
def _get_temp_dir(self):
4545
return tempfile.mkdtemp()
4646

47-
@pytest.mark.xfail(run=True, reason="PR 260 This test fails and needs to be fixed.")
47+
@pytest.mark.xfail(run=False, reason="PR 260 This test fails and needs to be fixed.")
4848
def test_stats_pipeline(self):
4949
record_batches = [
5050
pa.RecordBatch.from_arrays([
@@ -203,7 +203,7 @@ def test_stats_pipeline(self):
203203
}
204204
""", statistics_pb2.DatasetFeatureStatisticsList())
205205

206-
@pytest.mark.xfail(run=True, reason="PR 260 This test fails and needs to be fixed.")
206+
@pytest.mark.xfail(run=False, reason="PR 260 This test fails and needs to be fixed.")
207207
def test_stats_pipeline_with_examples_with_no_values(self):
208208
record_batches = [
209209
pa.RecordBatch.from_arrays([
@@ -321,7 +321,7 @@ def test_stats_pipeline_with_examples_with_no_values(self):
321321
test_util.make_dataset_feature_stats_list_proto_equal_fn(
322322
self, expected_result, check_histograms=False))
323323

324-
@pytest.mark.xfail(run=True, reason="PR 260 This test fails and needs to be fixed.")
324+
@pytest.mark.xfail(run=False, reason="PR 260 This test fails and needs to be fixed.")
325325
def test_stats_pipeline_with_zero_examples(self):
326326
expected_result = text_format.Parse(
327327
"""
@@ -343,7 +343,7 @@ def test_stats_pipeline_with_zero_examples(self):
343343
test_util.make_dataset_feature_stats_list_proto_equal_fn(
344344
self, expected_result, check_histograms=False))
345345

346-
@pytest.mark.xfail(run=True, reason="PR 260 This test fails and needs to be fixed.")
346+
@pytest.mark.xfail(run=False, reason="PR 260 This test fails and needs to be fixed.")
347347
def test_stats_pipeline_with_sample_rate(self):
348348
record_batches = [
349349
pa.RecordBatch.from_arrays(
@@ -493,7 +493,7 @@ def test_write_stats_to_tfrecord_and_binary(self):
493493

494494
class MergeDatasetFeatureStatisticsListTest(absltest.TestCase):
495495

496-
@pytest.mark.xfail(run=True, reason="PR 260 This test fails and needs to be fixed.")
496+
@pytest.mark.xfail(run=False, reason="PR 260 This test fails and needs to be fixed.")
497497
def test_merges_two_shards(self):
498498
stats1 = text_format.Parse(
499499
"""

tensorflow_data_validation/api/validation_api_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3241,7 +3241,7 @@ def _assert_skew_pairs_equal(self, actual, expected) -> None:
32413241
for each in actual:
32423242
self.assertIn(each, expected)
32433243

3244-
@pytest.mark.xfail(run=True, reason="PR 260 This test fails and needs to be fixed.")
3244+
@pytest.mark.xfail(run=False, reason="PR 260 This test fails and needs to be fixed.")
32453245
def test_detect_feature_skew(self):
32463246
training_data = [
32473247
text_format.Parse("""

tensorflow_data_validation/coders/csv_decoder_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@
366366
]
367367

368368

369-
@pytest.mark.xfail(run=True, reason="PR 260 This test fails and needs to be fixed. ")
369+
@pytest.mark.xfail(run=False, reason="PR 260 This test fails and needs to be fixed. ")
370370
class CSVDecoderTest(parameterized.TestCase):
371371
"""Tests for CSV decoder."""
372372

tensorflow_data_validation/integration_tests/sequence_example_e2e_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1738,7 +1738,7 @@
17381738
]
17391739

17401740

1741-
@pytest.mark.xfail(run=True, reason="PR 260 This test fails and needs to be fixed. ")
1741+
@pytest.mark.xfail(run=False, reason="PR 260 This test fails and needs to be fixed. ")
17421742
class SequenceExampleStatsTest(parameterized.TestCase):
17431743

17441744
@classmethod

tensorflow_data_validation/skew/feature_skew_detector_test.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def _make_ex(identifier: str,
142142

143143
class FeatureSkewDetectorTest(parameterized.TestCase):
144144

145-
@pytest.mark.xfail(run=True, reason="PR 260 This test fails and needs to be fixed.")
145+
@pytest.mark.xfail(run=False, reason="PR 260 This test fails and needs to be fixed.")
146146
def test_detect_feature_skew(self):
147147
baseline_examples, test_examples, _ = get_test_input(
148148
include_skewed_features=True, include_close_floats=True)
@@ -194,7 +194,7 @@ def test_detect_feature_skew(self):
194194
skew_result,
195195
test_util.make_skew_result_equal_fn(self, expected_result))
196196

197-
@pytest.mark.xfail(run=True, reason="PR 260 This test fails and needs to be fixed.")
197+
@pytest.mark.xfail(run=False, reason="PR 260 This test fails and needs to be fixed.")
198198
def test_detect_no_skew(self):
199199
baseline_examples, test_examples, _ = get_test_input(
200200
include_skewed_features=False, include_close_floats=False)
@@ -224,7 +224,7 @@ def test_detect_no_skew(self):
224224
util.assert_that(skew_sample, make_sample_equal_fn(self, 0, []),
225225
'CheckSkewSample')
226226

227-
@pytest.mark.xfail(run=True, reason="PR 260 This test fails and needs to be fixed.")
227+
@pytest.mark.xfail(run=False, reason="PR 260 This test fails and needs to be fixed.")
228228
def test_obtain_skew_sample(self):
229229
baseline_examples, test_examples, skew_pairs = get_test_input(
230230
include_skewed_features=True, include_close_floats=False)
@@ -248,7 +248,7 @@ def test_obtain_skew_sample(self):
248248
skew_sample, make_sample_equal_fn(self, sample_size,
249249
potential_samples))
250250

251-
@pytest.mark.xfail(run=True, reason="PR 260 This test fails and needs to be fixed.")
251+
@pytest.mark.xfail(run=False, reason="PR 260 This test fails and needs to be fixed.")
252252
def test_empty_inputs(self):
253253
baseline_examples, test_examples, _ = get_test_input(
254254
include_skewed_features=True, include_close_floats=True)
@@ -304,7 +304,7 @@ def test_empty_inputs(self):
304304
make_sample_equal_fn(self, 0, expected_result),
305305
'CheckSkewSample')
306306

307-
@pytest.mark.xfail(run=True, reason="PR 260 This test fails and needs to be fixed.")
307+
@pytest.mark.xfail(run=False, reason="PR 260 This test fails and needs to be fixed.")
308308
def test_float_precision_configuration(self):
309309
baseline_examples, test_examples, _ = get_test_input(
310310
include_skewed_features=True, include_close_floats=True)
@@ -395,7 +395,7 @@ def test_no_identifier_features(self):
395395
_ = ((baseline_examples, test_examples)
396396
| feature_skew_detector.DetectFeatureSkewImpl([]))
397397

398-
@pytest.mark.xfail(run=True, reason="PR 260 This test fails and needs to be fixed.")
398+
@pytest.mark.xfail(run=False, reason="PR 260 This test fails and needs to be fixed.")
399399
def test_duplicate_identifiers_allowed_with_duplicates(self):
400400
base_example_1 = text_format.Parse(
401401
"""
@@ -469,7 +469,7 @@ def test_duplicate_identifiers_allowed_with_duplicates(self):
469469
skew_result,
470470
test_util.make_skew_result_equal_fn(self, expected_result))
471471

472-
@pytest.mark.xfail(run=True, reason="PR 260 This test fails and needs to be fixed.")
472+
@pytest.mark.xfail(run=False, reason="PR 260 This test fails and needs to be fixed.")
473473
def test_duplicate_identifiers_not_allowed_with_duplicates(self):
474474
base_example_1 = text_format.Parse(
475475
"""
@@ -535,7 +535,7 @@ def test_duplicate_identifiers_not_allowed_with_duplicates(self):
535535
self.assertLen(actual_counter, 1)
536536
self.assertEqual(actual_counter[0].committed, 1)
537537

538-
@pytest.mark.xfail(run=True, reason="PR 260 This test fails and needs to be fixed.")
538+
@pytest.mark.xfail(run=False, reason="PR 260 This test fails and needs to be fixed.")
539539
def test_skips_missing_identifier_example(self):
540540
base_example_1 = text_format.Parse(
541541
"""
@@ -576,7 +576,7 @@ def test_skips_missing_identifier_example(self):
576576
runner = p.run()
577577
runner.wait_until_finish()
578578

579-
@pytest.mark.xfail(run=True, reason="PR 260 This test fails and needs to be fixed.")
579+
@pytest.mark.xfail(run=False, reason="PR 260 This test fails and needs to be fixed.")
580580
def test_empty_features_equivalent(self):
581581
base_example_1 = text_format.Parse(
582582
"""
@@ -626,7 +626,7 @@ def test_empty_features_equivalent(self):
626626
runner = p.run()
627627
runner.wait_until_finish()
628628

629-
@pytest.mark.xfail(run=True, reason="PR 260 This test fails and needs to be fixed.")
629+
@pytest.mark.xfail(run=False, reason="PR 260 This test fails and needs to be fixed.")
630630
def test_empty_features_not_equivalent_to_missing(self):
631631
base_example_1 = text_format.Parse(
632632
"""
@@ -699,7 +699,7 @@ def test_telemetry(self):
699699
self.assertLen(actual_counter, 1)
700700
self.assertEqual(actual_counter[0].committed, 1)
701701

702-
@pytest.mark.xfail(run=True, reason="PR 260 This test fails and needs to be fixed.")
702+
@pytest.mark.xfail(run=False, reason="PR 260 This test fails and needs to be fixed.")
703703
def test_confusion_analysis(self):
704704

705705
baseline_examples = [
@@ -834,7 +834,7 @@ def test_confusion_analysis_errors(self, input_example, expected_error_regex):
834834
feature_skew_detector.ConfusionConfig(name='val'),
835835
]))[feature_skew_detector.CONFUSION_KEY]
836836

837-
@pytest.mark.xfail(run=True, reason="PR 260 This test fails and needs to be fixed.")
837+
@pytest.mark.xfail(run=False, reason="PR 260 This test fails and needs to be fixed.")
838838
def test_match_stats(self):
839839
baseline_examples = [
840840
_make_ex('id0'),

0 commit comments

Comments
 (0)