Skip to content

Commit

Permalink
Minor changes to the handling of the extras key
Browse files Browse the repository at this point in the history
  • Loading branch information
IanHopkinson committed Sep 14, 2024
1 parent bf1bf5b commit d2a4e89
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/hdx_cli_toolkit/hdx_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ def parse_hdxerror_traceback(traceback_message: str):
message = "No HDX API key supplied Error"
elif "Maintainer does not exist" in traceback_message:
message = "Maintainer does not exist or is not a member of current owner organization Error"
elif "extras" in traceback_message:
# ckanapi.errors.ValidationError: {'extras': [{}, {'key':
# ['There is a schema field with the same name']}], '__type': 'Validation Error'}
elif "'extras'" in traceback_message:
message = "Extras Key Error"

return message
Expand Down
1 change: 1 addition & 0 deletions tests/test_hdx_utilities_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ def test_update_values_in_hdx_from_file():


def test_error_handling(capfd):
# This test isn't really testing the extras key issue
dataset = Dataset.read_from_hdx(DATASET_NAME)
key = "extras"
value = "Extras key is illegal"
Expand Down

0 comments on commit d2a4e89

Please sign in to comment.