Repository: meltano/sdk
Pull request #2867 (2025-02-03 23:52:57)

chore: pre-commit autoupdate
<!--pre-commit.ci start-->
updates:
- [github.com/python-jsonschema/check-jsonschema: 0.31.0 → 0.31.1](https://github.com/python-jsonschema/check-jsonschema/compare/0.31.0...0.31.1)
- [github.com/astral-sh/ruff-pre-commit: v0.9.3 → v0.9.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.9.3...v0.9.4)
<!--pre-commit.ci end-->

## Summary by Sourcery

Chores:
- Update pre-commit hooks for check-jsonschema to version 0.31.1 and ruff-pre-commit to version 0.9.4.

<!-- readthedocs-preview meltano-sdk start -->
----
📚 Documentation preview 📚: https://meltano-sdk--2867.org.readthedocs.build/en/2867/

<!-- readthedocs-preview meltano-sdk end -->

sourcery-ai[bot]: <!-- Generated by sourcery-ai[bot]: start review_guide -->

🧙 Sourcery is reviewing your pull request!

---

<details>
<summary>Tips and commands</summary>

#### Interacting with Sourcery

- **Trigger a new review:** Comment `@sourcery-ai review` on the pull request.
- **Continue discussions:** Reply directly to Sourcery's review comments.
- **Generate a GitHub issue from a review comment:** Ask Sourcery to create an
  issue from a review comment by replying to it. You can also reply to a
  review comment with `@sourcery-ai issue` to create an issue from it.
- **Generate a pull request title:** Write `@sourcery-ai` anywhere in the pull
  request title to generate a title at any time. You can also comment
  `@sourcery-ai title` on the pull request to (re-)generate the title at any time.
- **Generate a pull request summary:** Write `@sourcery-ai summary` anywhere in
  the pull request body to generate a PR summary at any time exactly where you
  want it. You can also comment `@sourcery-ai summary` on the pull request to
  (re-)generate the summary at any time.
- **Generate reviewer's guide:** Comment `@sourcery-ai guide` on the pull
  request to (re-)generate the reviewer's guide at any time.
- **Resolve all Sourcery comments:** Comment `@sourcery-ai resolve` on the
  pull request to resolve all Sourcery comments. Useful if you've already
  addressed all the comments and don't want to see them anymore.
- **Dismiss all Sourcery reviews:** Comment `@sourcery-ai dismiss` on the pull
  request to dismiss all existing Sourcery reviews. Especially useful if you
  want to start fresh with a new review - don't forget to comment
  `@sourcery-ai review` to trigger a new review!
- **Generate a plan of action for an issue:** Comment `@sourcery-ai plan` on
  an issue to generate a plan of action for it.

#### Customizing Your Experience

Access your [dashboard](https://app.sourcery.ai) to:
- Enable or disable review features such as the Sourcery-generated pull request
  summary, the reviewer's guide, and others.
- Change the review language.
- Add, remove or edit custom review instructions.
- Adjust other review settings.

#### Getting Help

- [Contact our support team](mailto:support@sourcery.ai) for questions or feedback.
- Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information.
- Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).

</details>

<!-- Generated by sourcery-ai[bot]: end review_guide -->

Patch:
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 64be2a0b..545b0d34 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -42,14 +42,14 @@ repos:
   - id: trailing-whitespace
 
 - repo: https://github.com/python-jsonschema/check-jsonschema
-  rev: 0.31.0
+  rev: 0.31.1
   hooks:
   - id: check-dependabot
   - id: check-github-workflows
   - id: check-readthedocs
 
 - repo: https://github.com/astral-sh/ruff-pre-commit
-  rev: v0.9.3
+  rev: v0.9.4
   hooks:
   - id: ruff
     args: [--fix, --exit-non-zero-on-fix, --show-fixes]
diff --git a/singer_sdk/streams/graphql.py b/singer_sdk/streams/graphql.py
index 22a5fb0c..a9aa86a0 100644
--- a/singer_sdk/streams/graphql.py
+++ b/singer_sdk/streams/graphql.py
@@ -24,7 +24,7 @@ class GraphQLStream(RESTStream, t.Generic[_TToken], metaclass=abc.ABCMeta):
     """
 
     path = ""
-    rest_method = "POST"
+    http_method = "POST"
 
     @classproperty
     def records_jsonpath(cls) -> str:  # type: ignore[override] # noqa: N805
diff --git a/singer_sdk/streams/rest.py b/singer_sdk/streams/rest.py
index cb964c24..3cc29154 100644
--- a/singer_sdk/streams/rest.py
+++ b/singer_sdk/streams/rest.py
@@ -6,7 +6,6 @@ import abc
 import copy
 import decimal
 import logging
-import sys
 import typing as t
 from functools import cached_property
 from http import HTTPStatus
@@ -29,11 +28,6 @@ from singer_sdk.pagination import (
 )
 from singer_sdk.streams.core import Stream
 
-if sys.version_info < (3, 13):
-    from typing_extensions import deprecated
-else:
-    from warnings import deprecated  # pragma: no cover
-
 if t.TYPE_CHECKING:
     from collections.abc import Iterable, Mapping
     from datetime import datetime
@@ -144,39 +138,21 @@ class _HTTPStream(Stream, t.Generic[_TToken], metaclass=abc.ABCMeta):  # noqa: P
 
     # HTTP Request functions
 
-    @property
-    @deprecated(
-        "Use `http_method` instead.",
-        category=SingerSDKDeprecationWarning,
-    )
-    def rest_method(self) -> str:
-        """HTTP method to use for requests. Defaults to "GET".
-
-        .. deprecated:: 0.43.0
-           Override :meth:`~singer_sdk.RESTStream.http_method` instead.
-        """
-        return self._http_method or "GET"
-
-    @rest_method.setter
-    @deprecated(
-        "Use `http_method` instead.",
-        category=SingerSDKDeprecationWarning,
-    )
-    def rest_method(self, value: str) -> None:
-        """Set the HTTP method for requests.
-
-        Args:
-            value: The HTTP method to use for requests.
-
-        .. deprecated:: 0.43.0
-           Override :meth:`~singer_sdk.RESTStream.http_method` instead.
-        """
-        self._http_method = value
-
     @property
     def http_method(self) -> str:
         """HTTP method to use for requests. Defaults to "GET"."""
-        return self._http_method or self.rest_method
+        if self._http_method:
+            return self._http_method
+
+        if hasattr(self, "rest_method"):
+            warn(
+                "Use `http_method` instead.",
+                SingerSDKDeprecationWarning,
+                stacklevel=2,
+            )
+            return self.rest_method  # type: ignore[no-any-return]
+
+        return "GET"
 
     @http_method.setter
     def http_method(self, value: str) -> None:


Test patch:
diff --git a/tests/core/test_streams.py b/tests/core/test_streams.py
index 8e4f164c..7d1b869f 100644
--- a/tests/core/test_streams.py
+++ b/tests/core/test_streams.py
@@ -7,6 +7,7 @@ import decimal
 import logging
 import typing as t
 import urllib.parse
+import warnings
 
 import pytest
 import requests
@@ -589,6 +590,10 @@ def test_mutate_http_method(tap: Tap, requests_mock: requests_mock.Mocker):
         context.reason = "Method Not Allowed"
         return {"error": "Check your method"}
 
+    with warnings.catch_warnings():
+        warnings.simplefilter("error")
+        assert RestTestStream(tap).http_method == "GET"
+
     class PostStream(RestTestStream):
         records_jsonpath = "$.data[*]"
         path = "/endpoint"
@@ -603,10 +608,16 @@ def test_mutate_http_method(tap: Tap, requests_mock: requests_mock.Mocker):
     with pytest.raises(FatalAPIError, match="Method Not Allowed"):
         list(stream.request_records(None))
 
-    with pytest.warns(SingerSDKDeprecationWarning):
-        stream.rest_method = "GET"
+    assert hasattr(stream, "http_method")
+    assert not hasattr(stream, "rest_method")
 
-    with pytest.raises(FatalAPIError, match="Method Not Allowed"):
+    stream.http_method = None
+    stream.rest_method = "GET"
+
+    with (
+        pytest.raises(FatalAPIError, match="Method Not Allowed"),
+        pytest.warns(SingerSDKDeprecationWarning),
+    ):
         list(stream.request_records(None))
 
     stream.http_method = "POST"