Repository: fractal-analytics-platform/fractal-client (language: python)

Issue:
Do not use `verbose` query parameter in `GET /api/v2/task/collect/{state_id}/`
This is being removed from the backend. Let's check if it was still present here, and drop it.


Discussion / hints:
We do have a `include_logs` argument.
When it is True, we have nothing to do.
When it is False, we should just replace `data["log"]` with `None` in the response.

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a84c9dc2..f88a89d7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,10 @@
 **Note**: Numbers like (\#123) point to closed Pull Requests on the fractal repository.
 
+# 2.3.1 (unreleased)
+
+* Internal:
+    * Update effect of `include_logs` for task-collection check command (\#730).
+
 # 2.3.0
 
 > WARNING: Starting from this release, Python3.9 is not supported any more.
diff --git a/fractal_client/cmd/_task.py b/fractal_client/cmd/_task.py
index 31c6389a..7565674e 100644
--- a/fractal_client/cmd/_task.py
+++ b/fractal_client/cmd/_task.py
@@ -123,13 +123,13 @@ def task_collection_check(
     include_logs: bool,
 ) -> Interface:
 
-    res = client.get(
-        f"{settings.BASE_URL}/task/collect/{state_id}/?verbose={include_logs}"
-    )
+    res = client.get(f"{settings.BASE_URL}/task/collect/{state_id}/")
     state = check_response(res, expected_status_code=200)
 
     # Remove key-value pairs with None value
     state["data"] = {key: val for (key, val) in state["data"].items() if val}
+    if (include_logs is False) and ("log" in state["data"]):
+        state["data"]["log"] = None
 
     return Interface(retcode=0, data=state)
 


Test patch:
diff --git a/tests/test_task_collection.py b/tests/test_task_collection.py
index 07b17125..1a355d18 100644
--- a/tests/test_task_collection.py
+++ b/tests/test_task_collection.py
@@ -113,12 +113,19 @@ def test_task_collection(invoke_as_custom_user, user_factory, new_name):
         assert time.perf_counter() - starting_time < COLLECTION_TIMEOUT
 
     res2 = invoke_as_custom_user(
+        f"task check-collection {state_id}", **new_user
+    )
+    assert res2.retcode == 0
+    assert res2.data["data"]["log"] is None
+
+    res3 = invoke_as_custom_user(
         f"task check-collection {state_id} --include-logs", **new_user
     )
-    debug(res2.data)
-    assert res2.retcode == 0j
-    res2.show()
-    assert res2.data["data"]["status"] == "OK"
+    assert res3.retcode == 0
+    assert res3.data["data"]["log"] is not None
+
+    res3.show()
+    assert res3.data["data"]["status"] == "OK"
 
     res = invoke_as_custom_user("task list", **new_user)
     assert len(res.data) == initial_task_list + 14