Skip to content

Commit

Permalink
Change to fix row numbering discrepancy (#1331)
Browse files Browse the repository at this point in the history
* row numbering fixes to discrepancies between Spreadsheet Validator/local processes as well as mistake in URL check errors
  • Loading branch information
gesinaphillips authored May 15, 2024
1 parent 9e8c74c commit b42126e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- Revert deprecation of field YAML files
- Update MUSIC directory schema
- Add semantic version to plugin test base class
- Fix row number mismatch between validation and spreadsheet validator response

## v0.0.18

Expand Down
9 changes: 5 additions & 4 deletions src/ingest_validation_tools/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,10 @@ def _api_validation(
if response.status_code != 200:
raise Exception(response.json())
elif response.json().get("reporting") and len(response.json().get("reporting")) > 0:
errors.extend(
[self._get_message(error, report_type) for error in response.json()["reporting"]]
)
for error in response.json()["reporting"]:
normalized_row = error.get("row") + 1
error["row"] = normalized_row
errors.append(self._get_message(error, report_type))
else:
logging.info(f"No errors found during CEDAR validation for {tsv_path}!")
logging.info(f"Response: {response.json()}.")
Expand Down Expand Up @@ -594,7 +595,7 @@ def _check_single_url(
error = {
"errorType": type(e).__name__,
"column": field,
"row": row_num + 2,
"row": row_num + 1,
"value": value,
"error_text": e.__str__(),
}
Expand Down

0 comments on commit b42126e

Please sign in to comment.