Skip to content

Commit

Permalink
Fix geopandas type check
Browse files Browse the repository at this point in the history
If geometry is None, it crashes:
```python
import hvplot.pandas
import censusdis.data as ced
from censusdis.datasets import ACS5
from censusdis.counties.washington import KING
from censusdis.states import WA

GROUP = "B25008"

gdf_king = ced.download(
    ACS5,
    2020,
    # Instead of listing the variables, we can ask for a whole group.
    group=GROUP,
    state=WA,
    county=KING,
    tract="*",
    with_geometry=True,
    # An optional flag that produces better maps in coastal areas.
    # More on this in the next lesson.
    remove_water=True,
)
gdf_king
```
  • Loading branch information
ahuang11 authored Jul 9, 2024
1 parent 667aaab commit a55cf7d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hvplot/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,7 @@ def _process_data(
self.data = data
if kind is None:
if datatype == 'geopandas':
geom_types = {gt[5:] if 'Multi' in gt else gt for gt in data.geom_type}
geom_types = {gt[5:] if gt and 'Multi' in gt else gt for gt in data.geom_type}
else:
geom_types = [
type(data.geometry.dtype)
Expand Down

0 comments on commit a55cf7d

Please sign in to comment.