From 64ea1d7b60c390b769a321bf22f6ac8922ac0144 Mon Sep 17 00:00:00 2001 From: Jason Regina Date: Fri, 19 May 2023 08:35:13 -0500 Subject: [PATCH] rename extra columns to match hydrotools canonical snake casing --- python/nwis_client/src/hydrotools/nwis_client/iv.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/python/nwis_client/src/hydrotools/nwis_client/iv.py b/python/nwis_client/src/hydrotools/nwis_client/iv.py index f68e39b3..d2a337d5 100644 --- a/python/nwis_client/src/hydrotools/nwis_client/iv.py +++ b/python/nwis_client/src/hydrotools/nwis_client/iv.py @@ -339,7 +339,15 @@ def empty_df_warning_helper(): "series", ] if include_expanded_metadata: - output_columns += expanded_columns + ["latitude", "longitude"] + expanded_column_mapping = { + "siteTypeCd": "site_type_code", + "hucCd": "huc_code", + "countyCd": "county_code", + "stateCd": "state_code", + "siteName": "site_name" + } + dfs = dfs.rename(columns=expanded_column_mapping) + output_columns += list(expanded_column_mapping.values()) + ["latitude", "longitude"] return dfs[output_columns] def get_raw(