From 26c03bfb0183a90beb8a905a39b00bd7947c429b Mon Sep 17 00:00:00 2001 From: Olexandr Balyk Date: Wed, 29 Nov 2023 01:43:28 -0500 Subject: [PATCH] Rename normalize_tags_columns_attr and update description (#139) This PR renames `normalize_tags_columns_attr` `normalize_tags_columns` and updates its description, since no normalisation is done in this function. --------- Co-authored-by: Siddharth Krishna --- times_reader/__main__.py | 2 +- times_reader/transforms.py | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/times_reader/__main__.py b/times_reader/__main__.py index 1aa869d..c5cbb03 100644 --- a/times_reader/__main__.py +++ b/times_reader/__main__.py @@ -54,7 +54,7 @@ def convert_xl_to_times( return {} transform_list = [ - transforms.normalize_tags_columns_attrs, + transforms.normalize_tags_columns, transforms.remove_fill_tables, transforms.remove_empty_tables, lambda config, tables: [transforms.remove_comment_rows(t) for t in tables], diff --git a/times_reader/transforms.py b/times_reader/transforms.py index 0b8b593..da1b07b 100644 --- a/times_reader/transforms.py +++ b/times_reader/transforms.py @@ -480,21 +480,18 @@ def discard(table): return [table for table in tables if not discard(table)] -def normalize_tags_columns_attrs( +def normalize_tags_columns( config: datatypes.Config, tables: List[datatypes.EmbeddedXlTable], ) -> List[datatypes.EmbeddedXlTable]: """ - Normalize (uppercase) tags, (lowercase) column names, and (uppercase) values in - attribute columns. + Normalize (uppercase) tags and (lowercase) column names. :param tables: List of tables in EmbeddedXlTable format. :return: List of tables in EmbeddedXlTable format with normalzed values. """ - # TODO Normalize column names and attribute values in mapping.txt when reading it - # TODO Check all string literals left in file def normalize(table: datatypes.EmbeddedXlTable) -> datatypes.EmbeddedXlTable: # Only uppercase upto ':', the rest can be non-uppercase values like regions parts = table.tag.split(":")