aboutsummaryrefslogtreecommitdiff
path: root/quality_control
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-05-18 16:38:52 +0300
committerFrederick Muriuki Muriithi2022-05-18 16:42:49 +0300
commit8f32812ce73193366ee00d883fd427c830f5a8e9 (patch)
treec97767451c09889cbcecd2bfaf883d25aa3afb23 /quality_control
parented7348ae2acefbb7806e26d5c13dfbd47ba1c9c0 (diff)
downloadgn-uploader-8f32812ce73193366ee00d883fd427c830f5a8e9.tar.gz
Simplify slot names and fix namedtuple type name
- replace `line_number` with `line` and `column_number` with `column` to save on slot name lengths. - Fix the type name for the `DuplicateHeading` namedtuple type
Diffstat (limited to 'quality_control')
-rw-r--r--quality_control/errors.py4
-rw-r--r--quality_control/headers.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/quality_control/errors.py b/quality_control/errors.py
index 1eda646..4206b5b 100644
--- a/quality_control/errors.py
+++ b/quality_control/errors.py
@@ -26,7 +26,7 @@ class ParseError(Exception):
super().__init__(*args)
InvalidValue = namedtuple(
- "InvalidValue", ("line_number", "column_number", "value", "message"))
+ "InvalidValue", ("line", "column", "value", "message"))
DuplicateHeading = namedtuple(
- "InvalidValue", ("line_number", "heading", "columns","message"))
+ "DuplicateHeading", ("line", "columns", "heading", "message"))
diff --git a/quality_control/headers.py b/quality_control/headers.py
index a5a5065..3b1e0e6 100644
--- a/quality_control/headers.py
+++ b/quality_control/headers.py
@@ -58,7 +58,7 @@ def duplicate_headings(
}
return tuple(
DuplicateHeading(
- line_number, heading, columns, (
+ line_number, columns, heading, (
f"Heading '{heading}', is repeated in columns "
f"{','.join(str(i) for i in columns)}"))
for heading, columns in repeated.items())