Skip to content

Commit 8ad842c

Browse files
bobrenjc93pytorchmergebot
authored andcommitted
remove allow-untyped-defs for utils/data/datapipes/dataframe/structures.py (pytorch#143273)
Pull Request resolved: pytorch#143273 Approved by: https://github.com/aorenste ghstack dependencies: pytorch#143271
1 parent 54ed13c commit 8ad842c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

torch/utils/data/datapipes/dataframe/structures.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# mypy: allow-untyped-defs
1+
from typing import Any, Iterator
2+
23
from torch.utils.data.datapipes.dataframe import dataframe_wrapper as df_wrapper
34
from torch.utils.data.datapipes.datapipe import DataChunk
45

@@ -9,11 +10,11 @@
910
class DataChunkDF(DataChunk):
1011
"""DataChunkDF iterating over individual items inside of DataFrame containers, to access DataFrames user `raw_iterator`."""
1112

12-
def __iter__(self):
13+
def __iter__(self) -> Iterator[Any]:
1314
for df in self.items:
1415
yield from df_wrapper.iterate(df)
1516

16-
def __len__(self):
17+
def __len__(self) -> int:
1718
total_len = 0
1819
for df in self.items:
1920
total_len += df_wrapper.get_len(df)

0 commit comments

Comments
 (0)