Skip to content

Commit

Permalink
addition to categories for hosting and div-branch renames for DSR
Browse files Browse the repository at this point in the history
  • Loading branch information
hhay1981 committed Jul 31, 2024
1 parent c4d2a51 commit 37f5fde
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 14 deletions.
1 change: 1 addition & 0 deletions push-data-to-metabase/OptimizeLookupCategories.csv
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,4 @@ License, Microsoft Power Pages - Authenticated User - Monthly
License, Microsoft Power Pages - Anonymous User - Monthly
Backup, Data Backup Services - Extended Retention
License,Microsoft Github Enterprise SL Per User - Monthly
License,Microsoft Power Automate Premium - Monthly
1 change: 1 addition & 0 deletions push-data-to-metabase/division_renames.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@
"Mines Competitiveness & Authorizations Division": "RMCD",
"Mines Health, Safety and Enforcement Division": "MHSE",
"Mines Health, Safety & Enforcement Division": "MHSE",
"Mines Health, Safety & Enfocement Division": "MHSE",
"Oil and Gas Division": "OGD",
"Strategic and Indigenous Affairs Division": "SIPD",
"Strategic and Indigenous Partnerships Division": "SIPD",
Expand Down
105 changes: 91 additions & 14 deletions push-data-to-metabase/push_h_sfp_to_metabase_dsr.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,28 @@ def get_records_from_xlsx(sheet_name):
"branch",
] = "Business Delivery Branch"

# correct info for EMLI
combined.loc[
combined["division"]
== "Mines Health, Safety and Enfocement Division",
"division",
] = "Mines Health, Safety & Enforcement Division"
combined.loc[
combined["division"]
== "Mines Health, Safety and Enforcement",
"division",
] = "Mines Health, Safety & Enforcement Division"
combined.loc[
combined["division"]
== "Mines Health, Safety and Enforcement Division",
"division",
] = "Mines Health, Safety & Enforcement Division"
combined.loc[
combined["division"]
== "Energy Resource Division",
"division",
] = "Energy Resources Division"

# correct info for ENV EPD
combined.loc[
combined["branch"] == "Environmental Emergencies and Land Remediation",
Expand All @@ -273,15 +295,6 @@ def get_records_from_xlsx(sheet_name):
combined["branch"] == "Environmental Standards Branch ",
"branch",
] = "Environmental Standards Branch"
combined.loc[
combined["branch"]
== "Regional Operations Branch - Coast/West Coast/Vancouver Island",
"branch",
] = "Regional Operations Branch"
combined.loc[
combined["branch"] == "Regional Operations Branch Authorizations South",
"branch",
] = "Regional Operations Branch"
combined.loc[
combined["branch"] == "Environment Protection Regional Operations Branch",
"branch",
Expand All @@ -295,14 +308,78 @@ def get_records_from_xlsx(sheet_name):
"branch",
] = "Regional Operations Branch"
combined.loc[
combined["branch"] == "Coast/West Coast/Vancouver Island",
"branch",
] = "Regional Operations Branch"
combined["branch"] == "BC Parks, Recreation Sites and Trails Division",
"division",
] = "Conservation and Recreation Division"
combined.loc[
combined["division"]
== "Environmental Sustainability Division",
"division",
] = "Environmental Protection Division"
combined.loc[
combined["branch"]
== "Regional Operations Branch - Interior - Thompson/Cariboo",
== "Environmental Protection Division",
"division",
] = "Environmental Protection Division"
combined.loc[
(combined["division"]
== "Strategic Policy Division") & (combined["branch"]
== "Knowledge Management Branch"),
"division",
] = "Strategic Services Division"
combined.loc[
(combined["division"]
== "ENV - Environment and Climate Change Strategy") | (combined["division"]
== "BC Parks Reg Ops"),
"division",
] = "Conservation and Recreation Division"
combined.loc[
(combined["division"]
== "BC Parks and Conservation Officer Services Division") & (combined["branch"]
== "BC Parks Regional Operations") | (combined["branch"]
== "BC Parks Regional Operations - Coast/West Coast/Vancouver") | (combined["branch"]
== "BC Parks Regional Operations - Coast/West Coast/Vancouver Island") | (combined["branch"]
== "BC Parks Regional Operations - Interior - Kootenay/Okanagan") | (combined["branch"]
== "BC Parks Regional Operations - Interior - Thompson/Cariboo") | (combined["branch"]
== "BC Parks Regional Operations - Kamloops Thompson-Cariboo Region") | (combined["branch"]
== "BC Parks Regional Operations - Northern") | (combined["branch"]
== "BC Parks Regional Operations - South Coast") | (combined["branch"]
== "BC Parks Regional Operations-Northern") | (combined["branch"]
== "BC Parks - Bella Coola"),
"division",
] = "Conservation and Recreation Division"
combined.loc[
combined["division"]
== "Policy, Programs & Partnerships Division",
"division",
] = "Climate Action Secretariat"
combined.loc[
(combined["division"]
== "BC Parks and Conservation Officer Services Division") & (combined["branch"]
== "ADM's Office") | (combined["branch"]
== "Provincial Services Branch"),
"division",
] = "Conservation and Recreation Division"
combined.loc[
(combined["branch"]
== "Conservation Officer Service Branch") | (combined["branch"]
== "Conservation Officer Service") | (combined["branch"]
== "Conservation Officer Services"),
"division",
] = "Conservation and Recreation Division"
combined.loc[
(combined["division"]
== "BC Parks and Conservation Officer Services Division") & (combined["branch"]
== "Kamloops"),
"division",
] = "Conservation and Recreation Division"
combined.loc[
(combined["division"]
== "Conservation and Recreation Division") | (combined["division"]
== "BC Parks, Recreation Sites and Trails Division") & (combined["branch"]
== "Regional Operations Branch"),
"branch",
] = "Regional Operations Branch"
] = "BC Parks - Regional Operations Branch"

elif sheet_name.lower() == "group shares":
combined.columns = ["sharename", "server", "datausage", "ministry", "date"]
Expand Down

0 comments on commit 37f5fde

Please sign in to comment.