p-e-w/heretic · error · ValueError
The "column" field is required for datasets: {path}
Error message
The "column" field is required for datasets: {path} What it means
Dataset sources must declare which column of the dataset contains the prompts. load_prompts raises this ValueError when the specification names a dataset but leaves `column` unset, because the library cannot infer which field holds the prompt text.
Source
Thrown at src/heretic/utils.py:192
if os.path.isfile(path):
# Plain text file with one prompt per line. Empty lines are ignored.
with open(path, encoding="utf-8") as file:
prompts = [line.strip() for line in file if line.strip()]
# The split is optional for text files. When given, it selects a subset
# of the lines using slice notation (e.g. "[:400]"). A synthetic split
# name is prepended because ReadInstruction expects a named split.
if split_str is not None:
start, end = get_split_slice(f"_{split_str}", len(prompts))
prompts = prompts[start:end]
else:
# All dataset sources require an explicit split and column.
if split_str is None:
raise ValueError(f'The "split" field is required for datasets: {path}')
if specification.column is None:
raise ValueError(f'The "column" field is required for datasets: {path}')
if is_hf_path(path):
# Pin to the latest commit if not already set, so the exact dataset
# version is recorded for reproducibility.
if specification.commit is None:
try:
specification.commit = huggingface_hub.dataset_info(path).sha
except Exception as error:
# Fetching the commit hash requires internet access, but the
# dataset itself may be fully cached locally. Proceed without
# pinning; an unpinned dataset disables the reproducibility
# offer during upload.
print(
f"[yellow]Warning: Could not fetch the latest commit hash for dataset [bold]{path}[/] ({error}). "
"The dataset version will not be pinned.[/]"
)
dataset = load_dataset(
path,View on GitHub (pinned to bedb94ef11)
Solutions
- Add a `column` field naming the prompt column (e.g. "question").
- Inspect the dataset's schema/features to confirm the exact column name.
- Re-run after aligning column with the actual dataset fields.
Example fix
// before
{"dataset": {"path": "openai/gsm8k", "split": "test"}}
// after
{"dataset": {"path": "openai/gsm8k", "split": "test", "column": "question"}} Defensive patterns
Strategy: validation
Validate before calling
cfg = spec["dataset"]
assert cfg.get("column"), 'dataset config must include a "column" field' Type guard
def dataset_config_is_complete(cfg: dict) -> bool:
return bool(cfg.get("split")) and bool(cfg.get("column")) Try / catch
try:
prompts = load_prompts(specification)
except ValueError as e:
if '"column" field is required' in str(e):
print(f"Add column to dataset config for {specification.path}")
else:
raise Prevention
- Inspect dataset features to find the prompt column name.
- Always include split and column together for datasets.
- Validate config against a schema (e.g. pydantic) before calling load_prompts.
When it happens
Trigger: Loading a dataset path in the prompt config without a `column` field, even when `split` is provided.
Common situations: Dataset schemas where the prompt column is named question/prompt/text/something custom; switching datasets without updating the column name.
Related errors
- The "split" field is required for datasets: {path}
- Plugin '{name}' does not export a class named '{class_name}'
- You must append the plugin class name to the filepath like t
- File-based plugin must use the form 'path/to/plugin.py:Class
- Import-based plugin must use the form 'fully.qualified.modul
AI-assisted analysis of p-e-w/heretic@bedb94ef11 (2026-08-29).
Data as JSON: /api/errors/e7d556ca8f567c6d.
Report an issue: GitHub.