diff --git a/etl/join_building_data/load_csv.py b/etl/join_building_data/load_csv.py index d7927c34..0afebe14 100644 --- a/etl/join_building_data/load_csv.py +++ b/etl/join_building_data/load_csv.py @@ -60,9 +60,14 @@ def main(base_url, api_key, source_file, json_columns): if building_id is None: continue + if 'sust_dec' in line and line['sust_dec'] == '': + del line['sust_dec'] + response_code, response_data = update_building(building_id, line, api_key, base_url) if response_code != 200: print('ERROR', building_id, response_code, response_data) + else: + print('DEBUG', building_id, response_code, response_data) def update_building(building_id, data, api_key, base_url): @@ -82,6 +87,7 @@ def find_building(data, base_url): if building_id is not None: print("match_by_building_id", building_id) return building_id + if 'toid' in data: building_id = find_by_reference(base_url, 'toid', data['toid']) if building_id is not None: