Skip to content

Commit

Permalink
map all pm fields to something
Browse files Browse the repository at this point in the history
  • Loading branch information
nllong committed Dec 15, 2016
1 parent cc841ec commit 415c65a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion seed/lib/mappings/mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def get_pm_mapping(raw_columns, mapping_data=None, resolve_duplicates=True):
if not column_found:
# if we get here then the columns was never found
_log.debug("Could not find applicable mappings, resorting to raw field ({}) in PropertyState".format(c['raw']))
# final_mappings[c['raw']] = ('PropertyState', c['raw'], 100)
final_mappings[c['raw']] = ('PropertyState', c['raw'], 100)

# verify that there are no duplicate matchings
if resolve_duplicates:
Expand Down
6 changes: 5 additions & 1 deletion seed/lib/mappings/test_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def test_mapping_pm_to_seed(self):
"Address_1",
"Property ID",
"Portfolio Manager Property ID",
"some_other_field_not_in_the_designated_PM_mapping",
"random",
"site eui",
"site Eui (kBTU/ft2)",
"site EUI",
Expand All @@ -135,10 +135,13 @@ def test_mapping_pm_to_seed(self):
'Address_1': (u'PropertyState', u'address_line_1', 100),
'Property ID': (u'PropertyState', u'pm_property_id', 100),
'Portfolio Manager Property ID': (u'PropertyState', u'pm_property_id', 100),
'random': (u'PropertyState', u'random', 100),
'site eui': (u'PropertyState', u'site_eui', 100),
'site Eui (kBTU/ft2)': (u'PropertyState', u'site_eui', 100),
'site EUI': (u'PropertyState', u'site_eui', 100)
}
print pm

self.assertDictEqual(pm, expected)

pm = get_pm_mapping(from_columns, resolve_duplicates=True)
Expand All @@ -147,6 +150,7 @@ def test_mapping_pm_to_seed(self):
'Address_1': (u'PropertyState', u'address_line_1_duplicate_1', 100),
'Property ID': (u'PropertyState', u'pm_property_id', 100),
'Portfolio Manager Property ID': (u'PropertyState', u'pm_property_id_duplicate_1', 100),
'random': (u'PropertyState', u'random', 100),
'site eui': (u'PropertyState', u'site_eui', 100),
'site Eui (kBTU/ft2)': (u'PropertyState', u'site_eui_duplicate_1', 100),
'site EUI': (u'PropertyState', u'site_eui_duplicate_2', 100)
Expand Down

0 comments on commit 415c65a

Please sign in to comment.