Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validation error report update #176

Merged
merged 2 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <[email protected]>"]
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
Loading