Skip to content

Commit 066465e

Browse files
authored
Emit Python warnings for beta and tech preview APIs (elastic#2675)
1 parent 94573cf commit 066465e

30 files changed

+373
-25
lines changed

elasticsearch/_async/client/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,10 @@
8282
_TYPE_HOSTS,
8383
CLIENT_META_SERVICE,
8484
SKIP_IN_PATH,
85+
Stability,
8586
_quote,
8687
_rewrite_parameters,
88+
_stability_warning,
8789
client_node_configs,
8890
is_requests_http_auth,
8991
is_requests_node_class,
@@ -3570,6 +3572,7 @@ async def render_search_template(
35703572
@_rewrite_parameters(
35713573
body_fields=("context", "context_setup", "script"),
35723574
)
3575+
@_stability_warning(Stability.EXPERIMENTAL)
35733576
async def scripts_painless_execute(
35743577
self,
35753578
*,

elasticsearch/_async/client/cat.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@
2020
from elastic_transport import ObjectApiResponse, TextApiResponse
2121

2222
from ._base import NamespacedClient
23-
from .utils import SKIP_IN_PATH, _quote, _rewrite_parameters
23+
from .utils import (
24+
SKIP_IN_PATH,
25+
Stability,
26+
_quote,
27+
_rewrite_parameters,
28+
_stability_warning,
29+
)
2430

2531

2632
class CatClient(NamespacedClient):
@@ -2517,6 +2523,7 @@ async def snapshots(
25172523
)
25182524

25192525
@_rewrite_parameters()
2526+
@_stability_warning(Stability.EXPERIMENTAL)
25202527
async def tasks(
25212528
self,
25222529
*,

elasticsearch/_async/client/connector.py

+32-1
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,19 @@
2020
from elastic_transport import ObjectApiResponse
2121

2222
from ._base import NamespacedClient
23-
from .utils import SKIP_IN_PATH, _quote, _rewrite_parameters
23+
from .utils import (
24+
SKIP_IN_PATH,
25+
Stability,
26+
_quote,
27+
_rewrite_parameters,
28+
_stability_warning,
29+
)
2430

2531

2632
class ConnectorClient(NamespacedClient):
2733

2834
@_rewrite_parameters()
35+
@_stability_warning(Stability.EXPERIMENTAL)
2936
async def check_in(
3037
self,
3138
*,
@@ -67,6 +74,7 @@ async def check_in(
6774
)
6875

6976
@_rewrite_parameters()
77+
@_stability_warning(Stability.BETA)
7078
async def delete(
7179
self,
7280
*,
@@ -115,6 +123,7 @@ async def delete(
115123
)
116124

117125
@_rewrite_parameters()
126+
@_stability_warning(Stability.BETA)
118127
async def get(
119128
self,
120129
*,
@@ -170,6 +179,7 @@ async def get(
170179
"sync_cursor",
171180
),
172181
)
182+
@_stability_warning(Stability.EXPERIMENTAL)
173183
async def last_sync(
174184
self,
175185
*,
@@ -299,6 +309,7 @@ async def last_sync(
299309
@_rewrite_parameters(
300310
parameter_aliases={"from": "from_"},
301311
)
312+
@_stability_warning(Stability.BETA)
302313
async def list(
303314
self,
304315
*,
@@ -372,6 +383,7 @@ async def list(
372383
"service_type",
373384
),
374385
)
386+
@_stability_warning(Stability.BETA)
375387
async def post(
376388
self,
377389
*,
@@ -453,6 +465,7 @@ async def post(
453465
"service_type",
454466
),
455467
)
468+
@_stability_warning(Stability.BETA)
456469
async def put(
457470
self,
458471
*,
@@ -529,6 +542,7 @@ async def put(
529542
)
530543

531544
@_rewrite_parameters()
545+
@_stability_warning(Stability.BETA)
532546
async def sync_job_cancel(
533547
self,
534548
*,
@@ -576,6 +590,7 @@ async def sync_job_cancel(
576590
)
577591

578592
@_rewrite_parameters()
593+
@_stability_warning(Stability.BETA)
579594
async def sync_job_delete(
580595
self,
581596
*,
@@ -620,6 +635,7 @@ async def sync_job_delete(
620635
)
621636

622637
@_rewrite_parameters()
638+
@_stability_warning(Stability.BETA)
623639
async def sync_job_get(
624640
self,
625641
*,
@@ -664,6 +680,7 @@ async def sync_job_get(
664680
@_rewrite_parameters(
665681
parameter_aliases={"from": "from_"},
666682
)
683+
@_stability_warning(Stability.BETA)
667684
async def sync_job_list(
668685
self,
669686
*,
@@ -743,6 +760,7 @@ async def sync_job_list(
743760
@_rewrite_parameters(
744761
body_fields=("id", "job_type", "trigger_method"),
745762
)
763+
@_stability_warning(Stability.BETA)
746764
async def sync_job_post(
747765
self,
748766
*,
@@ -802,6 +820,7 @@ async def sync_job_post(
802820
)
803821

804822
@_rewrite_parameters()
823+
@_stability_warning(Stability.EXPERIMENTAL)
805824
async def update_active_filtering(
806825
self,
807826
*,
@@ -845,6 +864,7 @@ async def update_active_filtering(
845864
@_rewrite_parameters(
846865
body_fields=("api_key_id", "api_key_secret_id"),
847866
)
867+
@_stability_warning(Stability.BETA)
848868
async def update_api_key_id(
849869
self,
850870
*,
@@ -903,6 +923,7 @@ async def update_api_key_id(
903923
@_rewrite_parameters(
904924
body_fields=("configuration", "values"),
905925
)
926+
@_stability_warning(Stability.BETA)
906927
async def update_configuration(
907928
self,
908929
*,
@@ -958,6 +979,7 @@ async def update_configuration(
958979
@_rewrite_parameters(
959980
body_fields=("error",),
960981
)
982+
@_stability_warning(Stability.EXPERIMENTAL)
961983
async def update_error(
962984
self,
963985
*,
@@ -1013,6 +1035,7 @@ async def update_error(
10131035
@_rewrite_parameters(
10141036
body_fields=("advanced_snippet", "filtering", "rules"),
10151037
)
1038+
@_stability_warning(Stability.BETA)
10161039
async def update_filtering(
10171040
self,
10181041
*,
@@ -1074,6 +1097,7 @@ async def update_filtering(
10741097
@_rewrite_parameters(
10751098
body_fields=("validation",),
10761099
)
1100+
@_stability_warning(Stability.EXPERIMENTAL)
10771101
async def update_filtering_validation(
10781102
self,
10791103
*,
@@ -1127,6 +1151,7 @@ async def update_filtering_validation(
11271151
@_rewrite_parameters(
11281152
body_fields=("index_name",),
11291153
)
1154+
@_stability_warning(Stability.BETA)
11301155
async def update_index_name(
11311156
self,
11321157
*,
@@ -1180,6 +1205,7 @@ async def update_index_name(
11801205
@_rewrite_parameters(
11811206
body_fields=("description", "name"),
11821207
)
1208+
@_stability_warning(Stability.BETA)
11831209
async def update_name(
11841210
self,
11851211
*,
@@ -1234,6 +1260,7 @@ async def update_name(
12341260
@_rewrite_parameters(
12351261
body_fields=("is_native",),
12361262
)
1263+
@_stability_warning(Stability.BETA)
12371264
async def update_native(
12381265
self,
12391266
*,
@@ -1286,6 +1313,7 @@ async def update_native(
12861313
@_rewrite_parameters(
12871314
body_fields=("pipeline",),
12881315
)
1316+
@_stability_warning(Stability.BETA)
12891317
async def update_pipeline(
12901318
self,
12911319
*,
@@ -1339,6 +1367,7 @@ async def update_pipeline(
13391367
@_rewrite_parameters(
13401368
body_fields=("scheduling",),
13411369
)
1370+
@_stability_warning(Stability.BETA)
13421371
async def update_scheduling(
13431372
self,
13441373
*,
@@ -1391,6 +1420,7 @@ async def update_scheduling(
13911420
@_rewrite_parameters(
13921421
body_fields=("service_type",),
13931422
)
1423+
@_stability_warning(Stability.BETA)
13941424
async def update_service_type(
13951425
self,
13961426
*,
@@ -1443,6 +1473,7 @@ async def update_service_type(
14431473
@_rewrite_parameters(
14441474
body_fields=("status",),
14451475
)
1476+
@_stability_warning(Stability.EXPERIMENTAL)
14461477
async def update_status(
14471478
self,
14481479
*,

elasticsearch/_async/client/features.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from elastic_transport import ObjectApiResponse
2121

2222
from ._base import NamespacedClient
23-
from .utils import _rewrite_parameters
23+
from .utils import Stability, _rewrite_parameters, _stability_warning
2424

2525

2626
class FeaturesClient(NamespacedClient):
@@ -62,6 +62,7 @@ async def get_features(
6262
)
6363

6464
@_rewrite_parameters()
65+
@_stability_warning(Stability.EXPERIMENTAL)
6566
async def reset_features(
6667
self,
6768
*,

elasticsearch/_async/client/fleet.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@
2020
from elastic_transport import ObjectApiResponse
2121

2222
from ._base import NamespacedClient
23-
from .utils import SKIP_IN_PATH, _quote, _rewrite_parameters
23+
from .utils import (
24+
SKIP_IN_PATH,
25+
Stability,
26+
_quote,
27+
_rewrite_parameters,
28+
_stability_warning,
29+
)
2430

2531

2632
class FleetClient(NamespacedClient):
@@ -91,6 +97,7 @@ async def global_checkpoints(
9197
@_rewrite_parameters(
9298
body_name="searches",
9399
)
100+
@_stability_warning(Stability.EXPERIMENTAL)
94101
async def msearch(
95102
self,
96103
*,
@@ -277,6 +284,7 @@ async def msearch(
277284
"from": "from_",
278285
},
279286
)
287+
@_stability_warning(Stability.EXPERIMENTAL)
280288
async def search(
281289
self,
282290
*,

elasticsearch/_async/client/indices.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@
2020
from elastic_transport import HeadApiResponse, ObjectApiResponse
2121

2222
from ._base import NamespacedClient
23-
from .utils import SKIP_IN_PATH, _quote, _rewrite_parameters
23+
from .utils import (
24+
SKIP_IN_PATH,
25+
Stability,
26+
_quote,
27+
_rewrite_parameters,
28+
_stability_warning,
29+
)
2430

2531

2632
class IndicesClient(NamespacedClient):
@@ -1032,6 +1038,7 @@ async def delete_template(
10321038
)
10331039

10341040
@_rewrite_parameters()
1041+
@_stability_warning(Stability.EXPERIMENTAL)
10351042
async def disk_usage(
10361043
self,
10371044
*,
@@ -1114,6 +1121,7 @@ async def disk_usage(
11141121
@_rewrite_parameters(
11151122
body_name="config",
11161123
)
1124+
@_stability_warning(Stability.EXPERIMENTAL)
11171125
async def downsample(
11181126
self,
11191127
*,
@@ -1483,6 +1491,7 @@ async def explain_data_lifecycle(
14831491
)
14841492

14851493
@_rewrite_parameters()
1494+
@_stability_warning(Stability.EXPERIMENTAL)
14861495
async def field_usage_stats(
14871496
self,
14881497
*,

elasticsearch/_async/client/inference.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,19 @@
2020
from elastic_transport import ObjectApiResponse
2121

2222
from ._base import NamespacedClient
23-
from .utils import SKIP_IN_PATH, _quote, _rewrite_parameters
23+
from .utils import (
24+
SKIP_IN_PATH,
25+
Stability,
26+
_quote,
27+
_rewrite_parameters,
28+
_stability_warning,
29+
)
2430

2531

2632
class InferenceClient(NamespacedClient):
2733

2834
@_rewrite_parameters()
35+
@_stability_warning(Stability.EXPERIMENTAL)
2936
async def delete(
3037
self,
3138
*,
@@ -93,6 +100,7 @@ async def delete(
93100
)
94101

95102
@_rewrite_parameters()
103+
@_stability_warning(Stability.EXPERIMENTAL)
96104
async def get(
97105
self,
98106
*,
@@ -151,6 +159,7 @@ async def get(
151159
@_rewrite_parameters(
152160
body_fields=("input", "query", "task_settings"),
153161
)
162+
@_stability_warning(Stability.EXPERIMENTAL)
154163
async def inference(
155164
self,
156165
*,
@@ -237,6 +246,7 @@ async def inference(
237246
@_rewrite_parameters(
238247
body_name="inference_config",
239248
)
249+
@_stability_warning(Stability.EXPERIMENTAL)
240250
async def put(
241251
self,
242252
*,

0 commit comments

Comments
 (0)