Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Studio: explain the all-columns-dropped recipe error in UI terms (#12416)

Daniel Han37d6154d3d22
diff --git a/studio/backend/routes/data_recipe/validate.py b/studio/backend/routes/data_recipe/validate.py
index f9ba9b5aea0..bc5dda990a0 100644
--- a/studio/backend/routes/data_recipe/validate.py
+++ b/studio/backend/routes/data_recipe/validate.py
@@ -80,6 +80,20 @@ def _validate_github_seed_static(source: dict[str, Any]) -> list[ValidateError]:
return errors
+def _all_blocks_dropped_message(columns: list[Any]) -> str:
+ # Reword only: Data Designer's profiler also fails when no generated column is kept (#10836).
+ names = [
+ column.name
+ for column in columns
+ if getattr(column, "drop", False) and column.name != "_internal_row_id"
+ ]
+ listed = f" ({', '.join(names)})" if names else ""
+ return (
+ f'Every block is set to "Keep out of final dataset"{listed}. Turn that off on at least '
+ "one block: source data fields cannot be the only columns in the output."
+ )
+
+
def _collect_validation_errors(recipe: dict[str, Any]) -> list[ValidateError]:
try:
from data_designer.engine.compiler import (
@@ -118,7 +132,10 @@ def _collect_validation_errors(recipe: dict[str, Any]) -> list[ValidateError]:
continue
code = getattr(violation.type, "value", None)
path = violation.column if violation.column else None
- message = str(violation.message).strip() or "Validation failed."
+ if code == "all_columns_dropped":
+ message = _all_blocks_dropped_message(config.columns)
+ else:
+ message = str(violation.message).strip() or "Validation failed."
errors.append(
ValidateError(
message = message,
diff --git a/studio/backend/tests/test_data_recipe_validate_all_dropped.py b/studio/backend/tests/test_data_recipe_validate_all_dropped.py
new file mode 100644
index 00000000000..7e3632653d9
--- /dev/null
+++ b/studio/backend/tests/test_data_recipe_validate_all_dropped.py
@@ -0,0 +1,81 @@
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+from pathlib import Path
+from types import SimpleNamespace
+
+import pytest
+
+
+def _recipe(seed_file: Path, *, keep_upper: bool) -> dict:
+ return {
+ "model_providers": [
+ {"name": "p", "endpoint": "http://127.0.0.1:9", "provider_type": "openai"}
+ ],
+ "model_configs": [
+ {"alias": "m", "model": "x", "provider": "p", "inference_parameters": {}}
+ ],
+ "seed_config": {
+ "source": {"seed_type": "local", "path": str(seed_file)},
+ "sampling_strategy": "ordered",
+ "selection_strategy": {"start": 0, "end": 1},
+ },
+ "columns": [
+ {
+ "column_type": "llm-text",
+ "name": "draft",
+ "drop": True,
+ "model_alias": "m",
+ "prompt": "rewrite {{ output }}",
+ },
+ {
+ "column_type": "expression",
+ "name": "upper",
+ "drop": not keep_upper,
+ "expr": "{{ draft }}",
+ },
+ ],
+ }
+
+
[email protected](name = "seed_file")
+def fixture_seed_file(tmp_path: Path) -> Path:
+ pa = pytest.importorskip("pyarrow")
+ pq = pytest.importorskip("pyarrow.parquet")
+ path = tmp_path / "data.parquet"
+ pq.write_table(pa.table({"instruction": ["a"], "output": ["c"]}), path)
+ return path
+
+
+def _validate(recipe: dict):
+ pytest.importorskip("fastapi")
+ pytest.importorskip("data_designer")
+ from routes.data_recipe import validate as validate_module
+
+ return validate_module.validate(SimpleNamespace(recipe = recipe), via_api_key = False)
+
+
+def test_all_blocks_dropped_names_the_ui_toggle_and_blocks(seed_file: Path) -> None:
+ response = _validate(_recipe(seed_file, keep_upper = False))
+
+ assert response.valid is False
+ [error] = [e for e in response.errors if e.code == "all_columns_dropped"]
+ assert '"Keep out of final dataset" (draft, upper)' in error.message
+ assert "drop=False" not in error.message
+
+
+def test_one_block_kept_is_not_all_dropped(seed_file: Path) -> None:
+ response = _validate(_recipe(seed_file, keep_upper = True))
+
+ assert all(e.code != "all_columns_dropped" for e in response.errors)
+
+
+def test_message_skips_internal_row_id() -> None:
+ pytest.importorskip("fastapi")
+ from routes.data_recipe.validate import _all_blocks_dropped_message
+
+ columns = [
+ SimpleNamespace(name = "_internal_row_id", drop = True),
+ SimpleNamespace(name = "draft", drop = True),
+ ]
+ assert "(draft)." in _all_blocks_dropped_message(columns)