Skip to content

Commit 06d9726

Browse files
ejguanpmeierNicolasHug
authored
Remove usage of deprecated datapipe_only parameter (#6641)
* Ignore deprecation warning from traverse function * remove only_datapipe * reinstate warning ignore for DL test * ignore warning class wide due to priority Co-authored-by: Philip Meier <[email protected]> Co-authored-by: Nicolas Hug <[email protected]>
1 parent 0113b00 commit 06d9726

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

test/test_prototype_datasets_builtin.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323

2424
def extract_datapipes(dp):
25-
return get_all_graph_pipes(traverse(dp, only_datapipe=True))
25+
return get_all_graph_pipes(traverse(dp))
2626

2727

2828
@pytest.fixture(autouse=True)
@@ -42,6 +42,12 @@ def test_coverage():
4242
)
4343

4444

45+
# FIXME: This decorator only applies to `test_data_loader`, but we can't put it there because the class-wide fail on
46+
# warnings would take higher priority.
47+
# Although we are not using `traverse(..., only_datapipe=...)` in `test_data_loader` directly, the `DataLoader` does.
48+
# This will emit the warning, which in turn will fail the test if we don't ignore it. There is a push to fix this in
49+
# https://github.com/pytorch/pytorch/pull/85667.
50+
@pytest.mark.filterwarnings("ignore:`only_datapipe` is deprecated:FutureWarning")
4551
@pytest.mark.filterwarnings("error")
4652
class TestCommon:
4753
@pytest.mark.parametrize("name", datasets.list_datasets())
@@ -101,12 +107,11 @@ def test_transformable(self, dataset_mock, config):
101107

102108
next(iter(dataset.map(transforms.Identity())))
103109

104-
@pytest.mark.parametrize("only_datapipe", [False, True])
105110
@parametrize_dataset_mocks(DATASET_MOCKS)
106-
def test_traversable(self, dataset_mock, config, only_datapipe):
111+
def test_traversable(self, dataset_mock, config):
107112
dataset, _ = dataset_mock.load(config)
108113

109-
traverse(dataset, only_datapipe=only_datapipe)
114+
traverse(dataset)
110115

111116
@parametrize_dataset_mocks(DATASET_MOCKS)
112117
def test_serializable(self, dataset_mock, config):

0 commit comments

Comments
 (0)