From f7949eed59bdd3a17eb616dd4e617f534b7565c0 Mon Sep 17 00:00:00 2001 From: Hans-Chrstian Date: Thu, 21 Nov 2024 15:55:59 +0100 Subject: [PATCH] Remove support when numeric value is returned by wikidata --- ckanext/fairdatapoint/labels.py | 7 ------- ckanext/fairdatapoint/tests/test_labels.py | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/ckanext/fairdatapoint/labels.py b/ckanext/fairdatapoint/labels.py index d880904..c37e6ed 100644 --- a/ckanext/fairdatapoint/labels.py +++ b/ckanext/fairdatapoint/labels.py @@ -69,13 +69,6 @@ def resolve_labels(package_dict: dict) -> int: if "success" not in updated_labels: log.warning("Error updating labels: %s", updated_labels) - if updated_labels["success"].isnumeric(): - if not (len(translation_list) == int(updated_labels["success"])): - log.warning( - "Of %d labels, only %s updated successfully", - len(translation_list), - updated_labels["success"], - ) else: log.debug("Updated %s labels in database", updated_labels["success"]) return len(translation_list) diff --git a/ckanext/fairdatapoint/tests/test_labels.py b/ckanext/fairdatapoint/tests/test_labels.py index 8629e9a..6ffe633 100644 --- a/ckanext/fairdatapoint/tests/test_labels.py +++ b/ckanext/fairdatapoint/tests/test_labels.py @@ -121,7 +121,7 @@ def test_resolve_label_happy_flow( ] load_and_translate_uri.return_value = translation_list - get_action.return_value.return_value = {"success": "3"} + get_action.return_value.return_value = {"success": "3 updated succesfully"} assert resolve_labels({"theme": "http://www.wikidata.org/entity/Q29937289"}) == 3