diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 102898bb..66722388 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,6 +6,14 @@ Submit4DN Change Log ---------- +4.0.3 +===== + +`PR 176: bug fix on error reporting `_ + +* fix of bug introduced by the previous error reporting fix +* test to cover that case + 4.0.2 ===== diff --git a/pyproject.toml b/pyproject.toml index 8a4a6807..bd48ef40 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "Submit4DN" -version = "4.0.2" +version = "4.0.3" description = "Utility package for submitting data to the 4DN Data Portal" authors = ["4DN-DCIC Team "] license = "MIT" diff --git a/tests/test_import_data.py b/tests/test_import_data.py index cfe8e105..3382bf0b 100644 --- a/tests/test_import_data.py +++ b/tests/test_import_data.py @@ -280,16 +280,21 @@ def test_combine_set_expsets_with_existing(): def test_error_report(connection_mock): - # There are 6 errors in the err_dict, 5 of them are legit, 1 is checked against the all aliases list, and excluded + # There are 7 errors in the err_dict, 5 of them are legit, 2 are checked against the all aliases list, and excluded err_dict = { "title": "Unprocessable Entity", "status": "error", "errors": [ {"location": "body", "description": "Test for error with no name"}, - {# This one should be excluded from report as this alias is in the sheet alias list + { + # This one should be excluded from report as this alias is in the sheet alias list "name": "Schema: ", "location": "body", "description": "Unable to resolve link: siyuan-wang-lab:region_1MB_TAD_1"}, + { + # This also excluded - error format different (includes type name) + "name": "Schema: ", "location": "body", + "description": "Unable to resolve link: /GenomicRegion/siyuan-wang-lab:region_1MB_TAD_1"}, {"name": "Schema: ", "location": "body", "description": "Unable to resolve link: siyuan-wang-lab:region_5MB_TAD_2"}, {"location": "body", "name": "Schema: genome_location.1", diff --git a/wranglertools/import_data.py b/wranglertools/import_data.py index 7eaaae51..a92e8b95 100755 --- a/wranglertools/import_data.py +++ b/wranglertools/import_data.py @@ -798,6 +798,7 @@ def error_report(error_dic, sheet, all_aliases, connection, error_id=''): elif error_description.endswith(nf_txt): alias_bit = error_description.replace(nf_txt, '').replace("'", '') if alias_bit: + alias_bit = alias_bit.split('/')[-1] not_found = alias_bit.strip() # ignore ones about existing aliases if not_found and not_found in all_aliases: