Skip to content

Commit

Permalink
Merge pull request #176 from 4dn-dcic/ajs_validation_bug_fix
Browse files Browse the repository at this point in the history
validation error report update
  • Loading branch information
aschroed authored Jun 3, 2024
2 parents 0a9596f + a8c636c commit 1897045
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ Submit4DN
Change Log
----------

4.0.3
=====

`PR 176: bug fix on error reporting <https://github.com/4dn-dcic/Submit4DN/pull/176>`_

* fix of bug introduced by the previous error reporting fix
* test to cover that case

4.0.2
=====

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <support@4dnucleome.org>"]
license = "MIT"
Expand Down
9 changes: 7 additions & 2 deletions tests/test_import_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions wranglertools/import_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 1897045

Please sign in to comment.