apache/superset · error · DatasetColumnNotFoundError
Dataset column not found.
Error message
Dataset column not found.
What it means
DatasetColumnNotFoundError (HTTP 404, 'Dataset column not found.') is raised by the delete-dataset-column command when DatasetDAO.find_dataset_column(dataset_id, column_id) returns None — the requested column id does not exist within the given dataset. The lookup is scoped to the pair, so a column id that exists in a different dataset also raises this.
Source
Thrown at superset/commands/dataset/columns/delete.py:52
class DeleteDatasetColumnCommand(BaseCommand):
def __init__(self, dataset_id: int, model_id: int):
self._dataset_id = dataset_id
self._model_id = model_id
self._model: Optional[TableColumn] = None
@transaction(on_error=partial(on_error, reraise=DatasetColumnDeleteFailedError))
def run(self) -> None:
self.validate()
assert self._model
DatasetColumnDAO.delete([self._model])
def validate(self) -> None:
# Validate/populate model exists
self._model = DatasetDAO.find_dataset_column(self._dataset_id, self._model_id)
if not self._model:
raise DatasetColumnNotFoundError()
# Check editorship
try:
security_manager.raise_for_editorship(self._model)
except SupersetSecurityException as ex:
raise DatasetColumnForbiddenError() from ex
View on GitHub (pinned to f4587218dd)
Solutions
- Re-fetch the dataset columns (GET /api/v1/dataset/<dataset_id>/_columns or the dataset detail) and confirm the column id still exists under that dataset.
- If the dataset changed, refresh its metadata (POST /api/v1/dataset/<id>/refresh) and retry with the current column ids.
- Treat 404 as success for idempotent delete flows (the end state — column absent — is already achieved).
Defensive patterns
Strategy: try-catch
Validate before calling
# Confirm the column belongs to the dataset before deleting
from superset.daos.dataset import DatasetDAO
def column_in_dataset(dataset_id: int, column_id: int) -> bool:
return DatasetDAO.find_dataset_column(dataset_id, column_id) is not None Try / catch
from superset.commands.dataset.columns.exceptions import DatasetColumnNotFoundError
try:
DeleteDatasetColumnCommand(dataset_id, column_id).run()
except DatasetColumnNotFoundError:
pass # idempotent delete: the end state (column absent) already holds Prevention
- Re-fetch the column list right before mutating; don't reuse ids captured pages ago.
- Make delete flows idempotent by swallowing 404 on the specific resource.
- After dataset schema changes on the source table, refresh dataset metadata so ids stay current.
When it happens
Trigger: DELETE /api/v1/dataset/<dataset_id>/column/<column_id> where the column was already deleted, the id belongs to another dataset, or the dataset id is wrong. Also occurs when two actors delete the same column concurrently and the second request finds it gone.
Common situations: Stale UI state (column list fetched before another user/session removed the column); scripts reusing column ids after a dataset refresh changed columns; dataset metadata out of sync with the physical table.
Related errors
- Changing this dataset is forbidden.
- Dataset does not exist
- The database was not found.
- Database not found.
- A soft-deleted dataset (uuid %(uuid)s) already references th
AI-assisted analysis of apache/superset@f4587218dd (2026-08-14).
Data as JSON: /api/errors/58401808831c626f.
Report an issue: GitHub.