File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 55
66from __future__ import annotations
77
8+ from deprecated import deprecated
9+
810from dune_client .api .base import BaseRouter
911from dune_client .models import (
1012 DuneError ,
@@ -19,6 +21,10 @@ class CustomEndpointAPI(BaseRouter):
1921 get_custom_endpoint_result(): returns the results of a custom endpoint.
2022 """
2123
24+ @deprecated (
25+ version = "1.8.1" ,
26+ reason = "Custom endpoints feature is deprecated and will be removed in a future version" ,
27+ )
2228 def get_custom_endpoint_result (
2329 self ,
2430 handle : str ,
Original file line number Diff line number Diff line change 11import os
22import unittest
3+ import warnings
34
45import dotenv
56
@@ -15,8 +16,14 @@ def setUp(self) -> None:
1516
1617 def test_getting_custom_endpoint_results (self ):
1718 dune = DuneClient (self .valid_api_key )
18- results = dune .get_custom_endpoint_result ("dune" , "new-test" )
19- assert len (results .get_rows ()) == 10
19+ with warnings .catch_warnings (record = True ) as w :
20+ warnings .simplefilter ("always" )
21+ results = dune .get_custom_endpoint_result ("dune" , "new-test" )
22+ assert len (results .get_rows ()) == 10
23+ # Verify that a deprecation warning was issued
24+ assert len (w ) == 1
25+ assert issubclass (w [0 ].category , DeprecationWarning )
26+ assert "deprecated" in str (w [0 ].message ).lower ()
2027
2128
2229if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments