Skip to content

Commit

Permalink
Install missing types packages and fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
Jing Wang committed Jun 27, 2021
1 parent e25393d commit 4ee36eb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions dev_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ pytest
pytest-cov
pytest-random
sphinx
types-requests
types-simplejson
4 changes: 2 additions & 2 deletions pyhdfs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ def _request(
"http://{}{}{}".format(
host, WEBHDFS_PATH, url_quote(path.encode("utf-8"))
),
params=kwargs, # type: ignore
params=kwargs,
timeout=self.timeout,
allow_redirects=False,
**self._requests_kwargs,
Expand Down Expand Up @@ -597,7 +597,7 @@ def open(self, path: str, **kwargs: _PossibleArgumentTypes) -> IO[bytes]:
metadata_response.headers["location"], stream=True, **self._requests_kwargs
)
_check_response(data_response)
return data_response.raw # type: ignore
return data_response.raw # type: ignore[no-any-return]

def mkdirs(self, path: str, **kwargs: _PossibleArgumentTypes) -> bool:
"""Create a directory with the provided permission.
Expand Down
6 changes: 3 additions & 3 deletions test_pyhdfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def mock_request(method: str, url: str, **kwargs: object) -> requests.Response:
return _standby_response()
elif "localhost" in url:
active_count[0] += 1
return original_request(method, url, **kwargs)
return original_request(method, url, **kwargs) # type: ignore[arg-type]
else:
self.fail("Unexpected url {}".format(url)) # pragma: no cover

Expand Down Expand Up @@ -350,7 +350,7 @@ def mock_request(*args: object, **kwargs: object) -> requests.Response:
assert e.status_code == 500
assert e.exception == "SomeUnknownException"
assert e.message == "SomeUnknownException - some_test_msg"
assert e.newThing == "1" # type: ignore
assert e.newThing == "1" # type: ignore[attr-defined]
else:
self.fail("should have thrown") # pragma: no cover

Expand Down Expand Up @@ -392,7 +392,7 @@ def test_concat(self) -> None:
def test_concat_invalid(self) -> None:
client = make_client()
with self.assertRaises(ValueError):
client.concat("/a", "b") # type: ignore
client.concat("/a", "b") # type: ignore[arg-type]
with self.assertRaises(NotImplementedError):
client.concat("/a", ["/,"])

Expand Down

0 comments on commit 4ee36eb

Please sign in to comment.