Merge branch '7.x' into prepare-v7.6.0a1

This commit is contained in:
Seth Michael Larson
2020-03-16 07:14:36 -05:00
committed by GitHub
4 changed files with 51 additions and 2 deletions
+7 -2
View File
@@ -1,3 +1,4 @@
import warnings
from .utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH
@@ -58,7 +59,7 @@ class TasksClient(NamespacedClient):
)
@query_params("timeout", "wait_for_completion")
def get(self, task_id, params=None, headers=None):
def get(self, task_id=None, params=None, headers=None):
"""
Returns information about a task.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html>`_
@@ -70,7 +71,11 @@ class TasksClient(NamespacedClient):
complete (default: false)
"""
if task_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'task_id'.")
warnings.warn(
"Calling client.tasks.get() without a task_id is deprecated "
"and will be removed in v8.0. Use client.tasks.list() instead.",
DeprecationWarning,
)
return self.transport.perform_request(
"GET", _make_path("_tasks", task_id), params=params, headers=headers