
from typing import Any, Iterable

from iopath.common.file_io import PathHandler


class TabularUriParser:
    def parse_uri(self, uri: str) -> None:
        pass


class TabularPathHandler(PathHandler):
    def _opent(
        self, path: str, mode: str = "r", buffering: int = 32, **kwargs: Any
    ) -> Iterable[Any]:
        assert mode == "r"


from typing import Any

from iopath.common.file_io import PathHandler, TabularIO


class TabularUriParser:
    def parse_uri(self, uri: str) -> None:
        pass


class TabularPathHandler(PathHandler):
    def _opent(
        self, path: str, mode: str = "r", buffering: int = 32, **kwargs: Any
    ) -> TabularIO:
        assert mode == "r"

Update type signature of AIRStorePathHandler.opent()
Update type signature of AIRStorePathHandler.opent()

Summary:
The previous diff updated the type signature of the
`PathHandler.opent()` method to return a custom context manager. Here,
we update the return type of the overriden `AIRStorePathHandler.opent()`
method to return an implementation of the `PathHandlerContext` protocol,
namely the `AIRStoreRowDataLoader` instead of `Iterable[Any]` to allow
Pyre to carry out static type checking.

Reviewed By: mackorone

Differential Revision: D33833561

fbshipit-source-id: f642110645b147a955f4375fc24d4c29cdca6f26

  
- from typing import Any, Iterable
+ from typing import Any
  
- from iopath.common.file_io import PathHandler
+ from iopath.common.file_io import PathHandler, TabularIO
  
  
  class TabularUriParser:
      def parse_uri(self, uri: str) -> None:
          pass
  
  
  class TabularPathHandler(PathHandler):
      def _opent(
          self, path: str, mode: str = "r", buffering: int = 32, **kwargs: Any
-     ) -> Iterable[Any]:
+     ) -> TabularIO:
          assert mode == "r"
  
Update type signature of AIRStorePathHandler.opent()
## Code Before:

from typing import Any, Iterable

from iopath.common.file_io import PathHandler


class TabularUriParser:
    def parse_uri(self, uri: str) -> None:
        pass


class TabularPathHandler(PathHandler):
    def _opent(
        self, path: str, mode: str = "r", buffering: int = 32, **kwargs: Any
    ) -> Iterable[Any]:
        assert mode == "r"

## Instruction:
Update type signature of AIRStorePathHandler.opent()
## Code After:

from typing import Any

from iopath.common.file_io import PathHandler, TabularIO


class TabularUriParser:
    def parse_uri(self, uri: str) -> None:
        pass


class TabularPathHandler(PathHandler):
    def _opent(
        self, path: str, mode: str = "r", buffering: int = 32, **kwargs: Any
    ) -> TabularIO:
        assert mode == "r"
