Skip to content

Commit

Permalink
no deprecation for _raise_for_status
Browse files Browse the repository at this point in the history
  • Loading branch information
Wauplin committed Sep 1, 2022
1 parent 35902a7 commit a545192
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/huggingface_hub/utils/_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,12 @@ def hf_raise_for_status(
raise HfHubHTTPError(str(HTTPError), response=response) from e


@_deprecate_method(version="0.15", message="Use `hf_raise_for_status` instead.")
def _raise_for_status(response):
"""Keep alias for now.
Deprecated but will stay longer since used in transformers.
Deprecated but without warning since it is used in transformers.
TODO: deprecate this properly after next release (just after v0.10).
See https://github.com/huggingface/huggingface_hub/pull/1019#issuecomment-1233240452
"""
hf_raise_for_status(response)

Expand Down
1 change: 0 additions & 1 deletion tests/test_utils_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ def test_hf_raise_for_status_fallback(self) -> None:
self.assertEqual(context.exception.response.status_code, 404)
self.assertEqual(context.exception.response.url, "test_URL")

@expect_deprecation("_raise_for_status")
@patch("huggingface_hub.utils._errors.hf_raise_for_status")
def test_raise_for_status(self, mock_hf_raise_for_status: Mock) -> None:
"""Test `_raise_for_status` alias."""
Expand Down

0 comments on commit a545192

Please sign in to comment.