From 043e5994c73b9202ed8726392b6e764b107132c8 Mon Sep 17 00:00:00 2001 From: anon Date: Fri, 8 May 2026 17:13:02 +0200 Subject: [PATCH] Replace assert with direct call for table validation `assert _ensure_table_and_layer_exist_in_sdata(...)` is stripped under `python -O` / `PYTHONOPTIMIZE=1`, silently bypassing user-input validation. Call the function unconditionally so it raises `ValueError` regardless of interpreter optimization level. Fixes #616 --- src/spatialdata_plot/pl/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spatialdata_plot/pl/utils.py b/src/spatialdata_plot/pl/utils.py index 1fd24a8d..63efffd2 100644 --- a/src/spatialdata_plot/pl/utils.py +++ b/src/spatialdata_plot/pl/utils.py @@ -2577,7 +2577,7 @@ def _ensure_table_and_layer_exist_in_sdata( return True # not using any table - assert _ensure_table_and_layer_exist_in_sdata(param_dict.get("sdata"), table_name, table_layer) + _ensure_table_and_layer_exist_in_sdata(param_dict.get("sdata"), table_name, table_layer) method = param_dict.get("method") if method not in ["matplotlib", "datashader", None]: