diff --git a/src/huggingface_hub/utils/_errors.py b/src/huggingface_hub/utils/_errors.py index dcca3a3fd1..0e15103628 100644 --- a/src/huggingface_hub/utils/_errors.py +++ b/src/huggingface_hub/utils/_errors.py @@ -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) diff --git a/tests/test_utils_errors.py b/tests/test_utils_errors.py index 52fa026803..404d55e89d 100644 --- a/tests/test_utils_errors.py +++ b/tests/test_utils_errors.py @@ -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."""