Skip to content

Commit 0bb2019

Browse files
timtreisclaude
andcommitted
Only warn about table fallback when multiple tables exist
When there is exactly one table, the choice is unambiguous — no need to warn. The warning now only fires when there are multiple tables. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 860cc4e commit 0bb2019

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/spatialdata_plot/pl/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,9 @@ def _set_color_source_vec(
11191119
table_to_use = None
11201120
else:
11211121
table_keys = list(sdata.tables.keys())
1122-
if table_keys:
1122+
if len(table_keys) == 1:
1123+
table_to_use = table_keys[0]
1124+
elif len(table_keys) > 1:
11231125
table_to_use = table_keys[0]
11241126
logger.warning(f"No table name provided, using '{table_to_use}' as fallback for color mapping.")
11251127
else:

0 commit comments

Comments
 (0)