Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -189,10 +189,14 @@ def filter_results(results, country_filter, region_filter, end_year_range, crs_f
|
|
189 |
countries_in_region = c_list
|
190 |
|
191 |
crs_key = metadata.get("crs_key", "").strip()
|
192 |
-
#
|
193 |
-
|
194 |
-
|
195 |
-
|
|
|
|
|
|
|
|
|
196 |
|
197 |
# Enforce CRS filter only if specified.
|
198 |
if crs_filter != "All/Not allocated" and crs_combined:
|
|
|
189 |
countries_in_region = c_list
|
190 |
|
191 |
crs_key = metadata.get("crs_key", "").strip()
|
192 |
+
# Convert crs_key to a string and remove trailing ".0"
|
193 |
+
crs_key_clean = re.sub(r'\.0$', '', str(crs_key))
|
194 |
+
# Lookup using the cleaned key
|
195 |
+
new_crs_value = lookup_crs_value(crs_key_clean)
|
196 |
+
# Clean the lookup return value similarly
|
197 |
+
new_crs_value_clean = re.sub(r'\.0$', '', str(new_crs_value).strip())
|
198 |
+
crs_combined = f"{crs_key_clean}: {new_crs_value_clean}" if crs_key_clean else ""
|
199 |
+
|
200 |
|
201 |
# Enforce CRS filter only if specified.
|
202 |
if crs_filter != "All/Not allocated" and crs_combined:
|