Skip to content

Commit 7111643

Browse files
timtreisclaude
andcommitted
Fix early return order: check empty before assigning to sdata_filt
Assigning an empty GeoDataFrame to sdata_filt triggers ShapesModel validation which rejects empty geometry. Move the empty check before the assignment. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0bb2019 commit 7111643

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/spatialdata_plot/pl/render.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,9 @@ def _render_shapes(
244244
groups, color_source_vector, color_vector
245245
)
246246
shapes = shapes[keep].reset_index(drop=True)
247-
sdata_filt[element] = shapes
248247
if len(shapes) == 0:
249248
return
249+
sdata_filt[element] = shapes
250250

251251
# color_source_vector is None when the values aren't categorical
252252
if values_are_categorical and render_params.transfunc is not None:

0 commit comments

Comments
 (0)