Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emit Python warnings for beta and tech preview APIs #96

Merged
merged 5 commits into from
Nov 8, 2024
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
3 changes: 3 additions & 0 deletions elasticsearch_serverless/_async/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@
_TYPE_HOST,
CLIENT_META_SERVICE,
SKIP_IN_PATH,
Stability,
_quote,
_rewrite_parameters,
_stability_warning,
client_node_config,
is_requests_http_auth,
is_requests_node_class,
Expand Down Expand Up @@ -3070,6 +3072,7 @@ async def render_search_template(
@_rewrite_parameters(
body_fields=("context", "context_setup", "script"),
)
@_stability_warning(Stability.EXPERIMENTAL)
async def scripts_painless_execute(
self,
*,
Expand Down
32 changes: 31 additions & 1 deletion elasticsearch_serverless/_async/client/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,19 @@
from elastic_transport import ObjectApiResponse

from ._base import NamespacedClient
from .utils import SKIP_IN_PATH, _quote, _rewrite_parameters
from .utils import (
SKIP_IN_PATH,
Stability,
_quote,
_rewrite_parameters,
_stability_warning,
)


class ConnectorClient(NamespacedClient):

@_rewrite_parameters()
@_stability_warning(Stability.EXPERIMENTAL)
async def check_in(
self,
*,
Expand Down Expand Up @@ -67,6 +74,7 @@ async def check_in(
)

@_rewrite_parameters()
@_stability_warning(Stability.BETA)
async def delete(
self,
*,
Expand Down Expand Up @@ -115,6 +123,7 @@ async def delete(
)

@_rewrite_parameters()
@_stability_warning(Stability.BETA)
async def get(
self,
*,
Expand Down Expand Up @@ -157,6 +166,7 @@ async def get(
@_rewrite_parameters(
parameter_aliases={"from": "from_"},
)
@_stability_warning(Stability.BETA)
async def list(
self,
*,
Expand Down Expand Up @@ -230,6 +240,7 @@ async def list(
"service_type",
),
)
@_stability_warning(Stability.BETA)
async def post(
self,
*,
Expand Down Expand Up @@ -311,6 +322,7 @@ async def post(
"service_type",
),
)
@_stability_warning(Stability.BETA)
async def put(
self,
*,
Expand Down Expand Up @@ -387,6 +399,7 @@ async def put(
)

@_rewrite_parameters()
@_stability_warning(Stability.BETA)
async def sync_job_cancel(
self,
*,
Expand Down Expand Up @@ -434,6 +447,7 @@ async def sync_job_cancel(
)

@_rewrite_parameters()
@_stability_warning(Stability.BETA)
async def sync_job_delete(
self,
*,
Expand Down Expand Up @@ -478,6 +492,7 @@ async def sync_job_delete(
)

@_rewrite_parameters()
@_stability_warning(Stability.BETA)
async def sync_job_get(
self,
*,
Expand Down Expand Up @@ -522,6 +537,7 @@ async def sync_job_get(
@_rewrite_parameters(
parameter_aliases={"from": "from_"},
)
@_stability_warning(Stability.BETA)
async def sync_job_list(
self,
*,
Expand Down Expand Up @@ -601,6 +617,7 @@ async def sync_job_list(
@_rewrite_parameters(
body_fields=("id", "job_type", "trigger_method"),
)
@_stability_warning(Stability.BETA)
async def sync_job_post(
self,
*,
Expand Down Expand Up @@ -660,6 +677,7 @@ async def sync_job_post(
)

@_rewrite_parameters()
@_stability_warning(Stability.EXPERIMENTAL)
async def update_active_filtering(
self,
*,
Expand Down Expand Up @@ -703,6 +721,7 @@ async def update_active_filtering(
@_rewrite_parameters(
body_fields=("api_key_id", "api_key_secret_id"),
)
@_stability_warning(Stability.BETA)
async def update_api_key_id(
self,
*,
Expand Down Expand Up @@ -761,6 +780,7 @@ async def update_api_key_id(
@_rewrite_parameters(
body_fields=("configuration", "values"),
)
@_stability_warning(Stability.BETA)
async def update_configuration(
self,
*,
Expand Down Expand Up @@ -816,6 +836,7 @@ async def update_configuration(
@_rewrite_parameters(
body_fields=("error",),
)
@_stability_warning(Stability.EXPERIMENTAL)
async def update_error(
self,
*,
Expand Down Expand Up @@ -871,6 +892,7 @@ async def update_error(
@_rewrite_parameters(
body_fields=("advanced_snippet", "filtering", "rules"),
)
@_stability_warning(Stability.BETA)
async def update_filtering(
self,
*,
Expand Down Expand Up @@ -932,6 +954,7 @@ async def update_filtering(
@_rewrite_parameters(
body_fields=("validation",),
)
@_stability_warning(Stability.EXPERIMENTAL)
async def update_filtering_validation(
self,
*,
Expand Down Expand Up @@ -985,6 +1008,7 @@ async def update_filtering_validation(
@_rewrite_parameters(
body_fields=("index_name",),
)
@_stability_warning(Stability.BETA)
async def update_index_name(
self,
*,
Expand Down Expand Up @@ -1038,6 +1062,7 @@ async def update_index_name(
@_rewrite_parameters(
body_fields=("description", "name"),
)
@_stability_warning(Stability.BETA)
async def update_name(
self,
*,
Expand Down Expand Up @@ -1092,6 +1117,7 @@ async def update_name(
@_rewrite_parameters(
body_fields=("is_native",),
)
@_stability_warning(Stability.BETA)
async def update_native(
self,
*,
Expand Down Expand Up @@ -1144,6 +1170,7 @@ async def update_native(
@_rewrite_parameters(
body_fields=("pipeline",),
)
@_stability_warning(Stability.BETA)
async def update_pipeline(
self,
*,
Expand Down Expand Up @@ -1197,6 +1224,7 @@ async def update_pipeline(
@_rewrite_parameters(
body_fields=("scheduling",),
)
@_stability_warning(Stability.BETA)
async def update_scheduling(
self,
*,
Expand Down Expand Up @@ -1249,6 +1277,7 @@ async def update_scheduling(
@_rewrite_parameters(
body_fields=("service_type",),
)
@_stability_warning(Stability.BETA)
async def update_service_type(
self,
*,
Expand Down Expand Up @@ -1301,6 +1330,7 @@ async def update_service_type(
@_rewrite_parameters(
body_fields=("status",),
)
@_stability_warning(Stability.EXPERIMENTAL)
async def update_status(
self,
*,
Expand Down
12 changes: 11 additions & 1 deletion elasticsearch_serverless/_async/client/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,19 @@
from elastic_transport import ObjectApiResponse

from ._base import NamespacedClient
from .utils import SKIP_IN_PATH, _quote, _rewrite_parameters
from .utils import (
SKIP_IN_PATH,
Stability,
_quote,
_rewrite_parameters,
_stability_warning,
)


class InferenceClient(NamespacedClient):

@_rewrite_parameters()
@_stability_warning(Stability.EXPERIMENTAL)
async def delete(
self,
*,
Expand Down Expand Up @@ -93,6 +100,7 @@ async def delete(
)

@_rewrite_parameters()
@_stability_warning(Stability.EXPERIMENTAL)
async def get(
self,
*,
Expand Down Expand Up @@ -151,6 +159,7 @@ async def get(
@_rewrite_parameters(
body_fields=("input", "query", "task_settings"),
)
@_stability_warning(Stability.EXPERIMENTAL)
async def inference(
self,
*,
Expand Down Expand Up @@ -237,6 +246,7 @@ async def inference(
@_rewrite_parameters(
body_name="inference_config",
)
@_stability_warning(Stability.EXPERIMENTAL)
async def put(
self,
*,
Expand Down
9 changes: 8 additions & 1 deletion elasticsearch_serverless/_async/client/ml.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@
from elastic_transport import ObjectApiResponse

from ._base import NamespacedClient
from .utils import SKIP_IN_PATH, _quote, _rewrite_parameters
from .utils import (
SKIP_IN_PATH,
Stability,
_quote,
_rewrite_parameters,
_stability_warning,
)


class MlClient(NamespacedClient):
Expand Down Expand Up @@ -3919,6 +3925,7 @@ async def update_job(
@_rewrite_parameters(
body_fields=("number_of_allocations",),
)
@_stability_warning(Stability.BETA)
async def update_trained_model_deployment(
self,
*,
Expand Down
16 changes: 15 additions & 1 deletion elasticsearch_serverless/_async/client/search_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,19 @@
from elastic_transport import ObjectApiResponse

from ._base import NamespacedClient
from .utils import SKIP_IN_PATH, _quote, _rewrite_parameters
from .utils import (
SKIP_IN_PATH,
Stability,
_quote,
_rewrite_parameters,
_stability_warning,
)


class SearchApplicationClient(NamespacedClient):

@_rewrite_parameters()
@_stability_warning(Stability.BETA)
async def delete(
self,
*,
Expand Down Expand Up @@ -67,6 +74,7 @@ async def delete(
)

@_rewrite_parameters()
@_stability_warning(Stability.EXPERIMENTAL)
async def delete_behavioral_analytics(
self,
*,
Expand Down Expand Up @@ -108,6 +116,7 @@ async def delete_behavioral_analytics(
)

@_rewrite_parameters()
@_stability_warning(Stability.BETA)
async def get(
self,
*,
Expand Down Expand Up @@ -148,6 +157,7 @@ async def get(
)

@_rewrite_parameters()
@_stability_warning(Stability.EXPERIMENTAL)
async def get_behavioral_analytics(
self,
*,
Expand Down Expand Up @@ -193,6 +203,7 @@ async def get_behavioral_analytics(
@_rewrite_parameters(
parameter_aliases={"from": "from_"},
)
@_stability_warning(Stability.BETA)
async def list(
self,
*,
Expand Down Expand Up @@ -243,6 +254,7 @@ async def list(
@_rewrite_parameters(
body_name="search_application",
)
@_stability_warning(Stability.BETA)
async def put(
self,
*,
Expand Down Expand Up @@ -299,6 +311,7 @@ async def put(
)

@_rewrite_parameters()
@_stability_warning(Stability.EXPERIMENTAL)
async def put_behavioral_analytics(
self,
*,
Expand Down Expand Up @@ -342,6 +355,7 @@ async def put_behavioral_analytics(
body_fields=("params",),
ignore_deprecated_options={"params"},
)
@_stability_warning(Stability.BETA)
async def search(
self,
*,
Expand Down
9 changes: 8 additions & 1 deletion elasticsearch_serverless/_async/client/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,19 @@
from elastic_transport import ObjectApiResponse

from ._base import NamespacedClient
from .utils import SKIP_IN_PATH, _quote, _rewrite_parameters
from .utils import (
SKIP_IN_PATH,
Stability,
_quote,
_rewrite_parameters,
_stability_warning,
)


class TasksClient(NamespacedClient):

@_rewrite_parameters()
@_stability_warning(Stability.EXPERIMENTAL)
async def get(
self,
*,
Expand Down
Loading
Loading