Skip to content

Commit

Permalink
Fix geopandas type check (#1367)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahuang11 authored Jul 16, 2024
1 parent 9d2a8da commit 51a03c8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hvplot/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,9 @@ 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}
if None in geom_types:
geom_types.remove(None)
else:
geom_types = [
type(data.geometry.dtype)
Expand Down
5 changes: 5 additions & 0 deletions hvplot/tests/testgeo.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,11 @@ def test_polygons_turns_off_hover_when_there_are_no_fields_to_include(self):
opts = hv.Store.lookup_options('bokeh', polygons, 'plot').kwargs
assert 'hover' not in opts.get('tools')

def test_geometry_none(self):
polygons = self.polygons.copy()
polygons.geometry[1] = None
assert polygons.hvplot(geo=True)


class TestGeoUtil(TestCase):
def setUp(self):
Expand Down

0 comments on commit 51a03c8

Please sign in to comment.