Skip to content

Commit 016147e

Browse files
generatedunixname89002005307016meta-codesync[bot]
authored andcommitted
Remove unused type error suppressions - fair_infra
Summary: This diff was automatically generated by the Pyre per-target upgrade tool. It removes `# pyre-fixme` or `pyrefly: ignore` comments that are no longer needed because the underlying type errors have been resolved. Note that it will also aim to ensure type checking runs cleanly, and will add suppressions to existing type errors. #pyreupgrade Differential Revision: D116359364 fbshipit-source-id: 57c47ce4ca6a5a617c684220b1b0e195bb1af048
1 parent 2e0b84e commit 016147e

8 files changed

Lines changed: 2 additions & 22 deletions

File tree

iopath/common/azure_blob.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ def _next_chunk(self) -> None:
101101
logger.info(
102102
"Read next chunk: blob_name=%s, length=%d",
103103
blob_name,
104-
# pyre-ignore[6]
105104
len(self._chunk),
106105
)
107106
self._chunk_pos = 0
@@ -257,7 +256,6 @@ def flush(self) -> None:
257256
assert self._chunk is not None
258257

259258
block_id = self._new_block_id()
260-
# pyre-ignore[16]
261259
block_length = self._chunk.tell()
262260
# pyre-ignore[16]
263261
self._chunk.seek(0)

iopath/common/event_logger.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,8 @@ class EventLogger:
3838
# pyre-fixme[2]: Parameter must be annotated.
3939
def __init__(self, *args, **kwargs):
4040
if b_tmetry_available:
41-
# pyre-fixme[4]: Attribute must be annotated.
4241
self._writers = []
43-
# pyre-fixme[4]: Attribute must be annotated.
4442
self._evt = SimpleEventRecord()
45-
# pyre-fixme[4]: Attribute must be annotated.
4643
self._enabled = True
4744

4845
# pyre-fixme[3]: Return type must be annotated.

iopath/common/file_io.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def __init__(self, func: Callable[[], str]) -> None:
127127
def _get_value(self) -> str:
128128
if self._value is None:
129129
self._value = self._func()
130-
return self._value # pyre-ignore
130+
return self._value
131131

132132
def __fspath__(self) -> str:
133133
return self._get_value()
@@ -1080,7 +1080,7 @@ def get_path_handler(self, path: Union[str, os.PathLike]) -> PathHandler:
10801080
Returns:
10811081
handler (PathHandler)
10821082
"""
1083-
path = os.fspath(path) # pyre-ignore
1083+
path = os.fspath(path)
10841084
for p, handler in self._path_handlers.items():
10851085
if path.startswith(p):
10861086
return handler
@@ -1108,7 +1108,6 @@ def __log_tmetry_keys(self, handler: PathHandler, kvs: Dict[str, VTYPE]) -> None
11081108
)
11091109
self._enable_logging = False
11101110

1111-
# pyre-fixme[34]: `Variable[VTYPE <: [str, int, bool, float]]` isn't present in
11121111
# the function's parameters.
11131112
def __get_open_keys(self, path: str, mode: str, buffering: int) -> Dict[str, VTYPE]:
11141113
"""
@@ -1178,7 +1177,6 @@ def openw(
11781177
def open(
11791178
self,
11801179
path: str,
1181-
# pyrefly: ignore [unsupported-operation]
11821180
mode: Literal["rb", "wb", "ab", "xb", "r+b", "w+b", "a+b", "x+b"] = ...,
11831181
buffering: int = ...,
11841182
**kwargs: Any,
@@ -1188,7 +1186,6 @@ def open(
11881186
def open(
11891187
self,
11901188
path: str,
1191-
# pyrefly: ignore [unsupported-operation]
11921189
mode: Literal["r", "w", "a", "x", "r+", "w+", "a+", "x+", "rt", "wt"] = ...,
11931190
buffering: int = ...,
11941191
**kwargs: Any,

iopath/common/non_blocking_io.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,9 @@ def __init__(
6363
executor: User can optionally attach a custom executor to
6464
perform async operations through `PathHandler.__init__`.
6565
"""
66-
# pyre-fixme[4]: Attribute must be annotated.
6766
self._path_to_data = {} # Map from path to `PathData` object
6867
self._buffered = buffered
6968
self._IO = NonBlockingBufferedIO if self._buffered else NonBlockingIO
70-
# pyre-fixme[4]: Attribute must be annotated.
7169
self._pool = executor or concurrent.futures.ThreadPoolExecutor()
7270

7371
def get_non_blocking_io(
@@ -110,7 +108,6 @@ def get_non_blocking_io(
110108
self._path_to_data[path] = PathData(queue, t)
111109

112110
kwargs = {} if not self._buffered else {"buffering": buffering}
113-
# pyre-fixme[29]: `Type[Union[NonBlockingBufferedIO, NonBlockingIO]]` is not
114111
# a function.
115112
return self._IO(
116113
notify_manager=lambda io_callable: ( # Pass async jobs to manager
@@ -296,7 +293,6 @@ def close(self) -> None:
296293
# NOTE: To use this class, use `buffered=True` in `NonBlockingIOManager`.
297294
# NOTE: This class expects the IO mode to be buffered.
298295
class NonBlockingBufferedIO(io.IOBase):
299-
# pyre-fixme[4]: Attribute must be annotated.
300296
MAX_BUFFER_BYTES = 10 * 1024 * 1024 # 10 MiB
301297

302298
def __init__(
@@ -321,7 +317,6 @@ def __init__(
321317
self._callback_after_file_close = callback_after_file_close
322318

323319
self._buffers = [io.BytesIO()]
324-
# pyre-fixme[4]: Attribute must be annotated.
325320
self._buffer_size = buffering if buffering > 0 else self.MAX_BUFFER_BYTES
326321
self._close_called = False
327322

iopath/common/s3.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,7 @@ def __init__(
113113
# pyre-fixme[21]: Could not find module `boto3.s3.transfer`.
114114
from boto3.s3.transfer import TransferConfig
115115

116-
# pyre-fixme[4]: Attribute must be annotated.
117116
self.transfer_config = TransferConfig(
118-
# pyrefly: ignore [bad-argument-type]
119117
**(transfer_config_kwargs if transfer_config_kwargs else {})
120118
)
121119

@@ -639,7 +637,6 @@ def _rm(self, path: str, **kwargs: Any) -> None:
639637

640638

641639
class S3ChunkReadIO(io.BufferedIOBase):
642-
# pyre-fixme[4]: Attribute must be annotated.
643640
DEFAULT_CHUNK_SIZE = 50 * 1024 * 1024 # 50MB
644641

645642
# pyre-fixme[3]: Return type must be annotated.
@@ -656,7 +653,6 @@ def __init__(
656653
self.client = client
657654
self.bucket = bucket
658655
self.key = key
659-
# pyre-fixme[4]: Attribute must be annotated.
660656
self.timeout = timeout.total_seconds() if timeout is not None else None
661657
self.chunk_size = chunk_size
662658
self.offset = 0

tests/async_writes_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
from iopath.common.file_io import PathManager
1717

1818

19-
# pyre-fixme[5]: Global expression must be annotated.
2019
logger = logging.getLogger(__name__)
2120

2221

tests/test_download.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212

1313
class TestDownload(unittest.TestCase):
14-
# pyre-fixme[4]: Attribute must be annotated.
1514
_filename = "facebook_" + uuid.uuid4().hex + ".html"
1615

1716
# pyre-fixme[3]: Return type must be annotated.

tests/test_file_io.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,6 @@ def test_open_writes(self) -> None:
412412
# HTTPURLHandler does not support writing, only reading.
413413
with self.assertRaises(AssertionError):
414414
with self._pathmgr.open(self._remote_uri, "w") as f:
415-
# pyrefly: ignore [no-matching-overload]
416415
f.write("foobar")
417416

418417
def test_open_new_path_manager(self) -> None:

0 commit comments

Comments
 (0)