From eabcf77600783fdc38851d5bcce486ea9fbb296a Mon Sep 17 00:00:00 2001 From: aschroed Date: Fri, 31 May 2024 13:35:12 -0400 Subject: [PATCH 1/2] update to validation error reporting to deal with item type included in error response --- wranglertools/import_data.py | 1 + 1 file changed, 1 insertion(+) 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: From a8c636ce564e862dca3909af535c7f3c11e71089 Mon Sep 17 00:00:00 2001 From: aschroed Date: Mon, 3 Jun 2024 09:44:57 -0400 Subject: [PATCH 2/2] added test; version bump; update changelog --- CHANGELOG.rst | 8 ++++++++ pyproject.toml | 2 +- tests/test_import_data.py | 9 +++++++-- 3 files changed, 16 insertions(+), 3 deletions(-) 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",