Skip to content

Commit ff8c5c3

Browse files
committed
Adding deprecation warnings for archive readers
ghstack-source-id: 69ee7c8 Pull Request resolved: #272
1 parent 26fbcee commit ff8c5c3

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

torchdata/datapipes/iter/util/tararchiveloader.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
from io import BufferedIOBase
66
from typing import cast, IO, Iterable, Iterator, Optional, Tuple
77

8+
from torch.utils.data.datapipes.utils.common import deprecation_warning
9+
810
from torchdata.datapipes import functional_datapipe
911
from torchdata.datapipes.iter import IterDataPipe
1012

@@ -78,4 +80,5 @@ class TarArchiveReaderIterDataPipe(IterDataPipe[Tuple[str, BufferedIOBase]]):
7880
"""
7981

8082
def __new__(cls, datapipe: Iterable[Tuple[str, BufferedIOBase]], mode: str = "r:*", length: int = -1):
83+
deprecation_warning(type(cls).__name__, new_name="TarArchiveLoader")
8184
return TarArchiveLoaderIterDataPipe(datapipe, mode, length)

torchdata/datapipes/iter/util/xzfileloader.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
from io import BufferedIOBase
55
from typing import Iterable, Iterator, Tuple
66

7+
from torch.utils.data.datapipes.utils.common import deprecation_warning
8+
79
from torchdata.datapipes import functional_datapipe
810
from torchdata.datapipes.iter import IterDataPipe
911

@@ -67,4 +69,5 @@ class XzFileReaderIterDataPipe(IterDataPipe[Tuple[str, BufferedIOBase]]):
6769
"""
6870

6971
def __new__(cls, datapipe: Iterable[Tuple[str, BufferedIOBase]], length: int = -1):
72+
deprecation_warning(type(cls).__name__, new_name="XzFileLoader")
7073
return XzFileLoaderIterDataPipe(datapipe, length)

torchdata/datapipes/iter/util/ziparchiveloader.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
from io import BufferedIOBase
77
from typing import cast, IO, Iterable, Iterator, Tuple
88

9+
from torch.utils.data.datapipes.utils.common import deprecation_warning
10+
911
from torchdata.datapipes import functional_datapipe
1012
from torchdata.datapipes.iter import IterDataPipe
1113

@@ -79,4 +81,5 @@ class ZipArchiveReaderIterDataPipe(IterDataPipe[Tuple[str, BufferedIOBase]]):
7981
"""
8082

8183
def __new__(cls, datapipe: Iterable[Tuple[str, BufferedIOBase]], length: int = -1):
84+
deprecation_warning(type(cls).__name__, new_name="ZipArchiveLoader")
8285
return ZipArchiveLoaderIterDataPipe(datapipe, length)

0 commit comments

Comments
 (0)