From 4c36e070851c961df43303ae03b08721bfbb14c9 Mon Sep 17 00:00:00 2001 From: mm Date: Fri, 5 May 2023 05:45:01 +0000 Subject: [PATCH] bugfix --- generate_data.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/generate_data.py b/generate_data.py index cfe8e9a..c0d7899 100644 --- a/generate_data.py +++ b/generate_data.py @@ -57,11 +57,9 @@ def get_coordinates(city_name, country_code="US"): or None if the city is not found. """ search_results = gc.search_cities(city_name, case_sensitive=True) - search_results = { - k: c - for k, c in search_results.items() - if (c.get("countrycode") == country_code) - } + search_results = [ + d for d in search_results if (d.get("countrycode") == country_code) + ] if not search_results: return None