Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions dune_client/api/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

from __future__ import annotations

from deprecated import deprecated

from dune_client.api.base import BaseRouter
from dune_client.models import (
DuneError,
Expand All @@ -19,6 +21,10 @@ class CustomEndpointAPI(BaseRouter):
get_custom_endpoint_result(): returns the results of a custom endpoint.
"""

@deprecated(
version="1.8.1",
reason="Custom endpoints feature is deprecated and will be removed in a future version",
)
def get_custom_endpoint_result(
self,
handle: str,
Expand Down
11 changes: 9 additions & 2 deletions tests/e2e/test_custom_endpoints.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import unittest
import warnings

import dotenv

Expand All @@ -15,8 +16,14 @@ def setUp(self) -> None:

def test_getting_custom_endpoint_results(self):
dune = DuneClient(self.valid_api_key)
results = dune.get_custom_endpoint_result("dune", "new-test")
assert len(results.get_rows()) == 10
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always")
results = dune.get_custom_endpoint_result("dune", "new-test")
assert len(results.get_rows()) == 10
# Verify that a deprecation warning was issued
assert len(w) == 1
assert issubclass(w[0].category, DeprecationWarning)
assert "deprecated" in str(w[0].message).lower()


if __name__ == "__main__":
Expand Down