From 457ccd96c5da975d92a986e86a8d4493b0c26b6e Mon Sep 17 00:00:00 2001 From: Katherine Fleming <2205659+kflemin@users.noreply.github.com> Date: Mon, 23 Sep 2024 10:09:18 -0600 Subject: [PATCH] Revert "Add is_omitted column to column mapping profiles (#46)" This reverts commit 9224cb6de8273fd59fb26a88f9624d3a74d94294. --- pyseed/seed_client.py | 8 +++----- pyseed/utils.py | 21 +++++++++------------ tests/test_utils.py | 1 - 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/pyseed/seed_client.py b/pyseed/seed_client.py index 6b7b0e4..0b368e6 100644 --- a/pyseed/seed_client.py +++ b/pyseed/seed_client.py @@ -924,7 +924,6 @@ def create_or_update_column_mapping_profile( "from_units": null, "to_table_name": "PropertyState" "to_field": "address_line_1", - "is_omitted": False }, { "from_field": "address1", @@ -935,7 +934,6 @@ def create_or_update_column_mapping_profile( ... ] - The is_omitted mapping may be absent - it is treated as False if it is not present. Returns: dict: { 'id': 1 @@ -974,9 +972,9 @@ def create_or_update_column_mapping_profile_from_file( ) -> dict: """creates or updates a mapping profile. The format of the mapping file is a CSV with the following format: - Raw Columns, units, SEED Table, SEED Columns, Omit\n - PM Property ID, , PropertyState, pm_property_id, False\n - Building ID, , PropertyState, custom_id_1, False\n + Raw Columns, units, SEED Table, SEED Columns\n + PM Property ID, , PropertyState, pm_property_id\n + Building ID, , PropertyState, custom_id_1\n ...\n This only works for 'Normal' column mapping profiles, that is, it does not work for diff --git a/pyseed/utils.py b/pyseed/utils.py index ee09ef4..e10fd59 100644 --- a/pyseed/utils.py +++ b/pyseed/utils.py @@ -113,18 +113,15 @@ def read_map_file(mapfile_path): # Open the mapping file and fill list maplist = list() + for rowitem in map_reader: - data = { - "from_field": rowitem[0], - "from_units": rowitem[1], - "to_table_name": rowitem[2], - "to_field": rowitem[3], - } - try: - data["is_omitted"] = True if rowitem[4].lower().strip() == "true" else False - except IndexError: - data["is_omitted"] = False - - maplist.append(data) + maplist.append( + { + 'from_field': rowitem[0], + 'from_units': rowitem[1], + 'to_table_name': rowitem[2], + 'to_field': rowitem[3], + } + ) return maplist diff --git a/tests/test_utils.py b/tests/test_utils.py index 7e1fd71..e7d1cc4 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -22,6 +22,5 @@ def test_mapping_file(self): "from_units": "ft**2", "to_field": "gross_floor_area", "to_table_name": "PropertyState", - "is_omitted": False } assert mappings[5] == expected