Restore and deprecate client.tasks.get() without task_id
This commit is contained in:
@@ -146,6 +146,13 @@ class API:
|
||||
p in url.get("parts", {}) for url in self._def["url"]["paths"]
|
||||
)
|
||||
|
||||
# This piece of logic corresponds to calling
|
||||
# client.tasks.get() w/o a task_id which was erroneously
|
||||
# allowed in the 7.1 client library. This functionality
|
||||
# is deprecated and will be removed in 8.x.
|
||||
if self.namespace == "tasks" and self.name == "get":
|
||||
parts["task_id"]["required"] = False
|
||||
|
||||
for k, sub in SUBSTITUTIONS.items():
|
||||
if k in parts:
|
||||
parts[sub] = parts.pop(k)
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
{% extends "base" %}
|
||||
{% block request %}
|
||||
if task_id in SKIP_IN_PATH:
|
||||
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,
|
||||
)
|
||||
|
||||
{{ super()|trim }}
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user