Skip to content

Commit

Permalink
chore: added checks for item identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
santilland committed Sep 28, 2023
1 parent f7cc22b commit 651fcdb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions generators/generate_indicators.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,11 @@ def handle_GeoDB_endpoint(config, endpoint, data, catalog):
countries.append(country)
if city not in cities:
cities.append(city)
# sanitize city identifier to be sure it is filename save
city = "".join([c for c in city if c.isalpha() or c.isdigit() or c==' ']).rstrip()
# Additional check to see if city name is empty afterwards
if city == "":
city = "undefined"
min_date = min(times)
max_date = max(times)
latlon = unique_values["aoi"]
Expand Down

0 comments on commit 651fcdb

Please sign in to comment.