rusackas commented on code in PR #38019:
URL: https://github.com/apache/superset/pull/38019#discussion_r3625536164


##########
superset-frontend/plugins/legacy-plugin-chart-country-map/scripts/Country Map 
GeoJSON Generator.ipynb:
##########
@@ -2384,6 +2384,18 @@
     "not speed_run and india_copy.plot(**plot_styles)"
    ]
   },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": "#### Kenya\nThe administrative divisions in the Natural Earth 
dataset are outdated since the 2010 constitution, see 
https://en.wikipedia.org/wiki/Counties_of_Kenya. County boundary data sourced 
from [geoBoundaries](https://www.geoboundaries.org) (CC BY 4.0), available on 
[OCHA 
HDX](https://data.humdata.org/dataset/geoboundaries-admin-boundaries-for-kenya)."
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": "kenya_copy = df[df.admin == 'Kenya'].copy()\n# Source: 
geoBoundaries Kenya ADM1 (CC BY 4.0) via OCHA HDX\n# 
https://data.humdata.org/dataset/geoboundaries-admin-boundaries-for-kenya\nkenya_geojson_url
 = 
\"https://github.com/wmgeolab/geoBoundaries/raw/9469f09/releaseData/gbOpen/KEN/ADM1/geoBoundaries-KEN-ADM1.geojson\"\n\ntry:\n
    kenya_gdf = gpd.read_file(kenya_geojson_url)\n    kenya_gdf = 
kenya_gdf.rename(columns={'shapeName': 'name', 'shapeISO': 'iso_3166_2'})\n    
kenya_copy = gpd.GeoDataFrame(\n        kenya_gdf,\n        
geometry='geometry',\n        crs=kenya_gdf.crs\n    )\n    \n    
print(\"GeoJSON file for Kenya downloaded and loaded successfully.\")\nexcept 
Exception as e:\n    print(f\"Unable to download or load the GeoJSON file for 
Kenya. Error: {str(e)}\")\n    print(\"Please download the file from the URL 
and try again.\")\n\nnot speed_run and kenya_copy.plot(**plot_styles)"

Review Comment:
   Good catch, fixed. The except now re-raises instead of silently falling back 
to the old Natural Earth geometry.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to