Skip to content

Commit

Permalink
Remove support when numeric value is returned by wikidata
Browse files Browse the repository at this point in the history
  • Loading branch information
Hans-Chrstian committed Nov 21, 2024
1 parent b3fcf8a commit f7949ee
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
7 changes: 0 additions & 7 deletions ckanext/fairdatapoint/labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion ckanext/fairdatapoint/tests/test_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit f7949ee

Please sign in to comment.