-
Notifications
You must be signed in to change notification settings - Fork 80
[Bug] Table context menu always fails to add or delete columns #257
Description
Description:
In dataloom-frontend/src/Components/Table.jsx, both handleAddColumn (line 92) and handleDeleteColumn (line 170) send the request body using the key col_params:
// handleAddColumn
operation_type: ADD_COLUMN,
col_params: { index, name: newColumnName },
// handleDeleteColumn
operation_type: DELETE_COLUMN,
col_params: { index: index - 1 },The backend TransformationInput schema in app/schemas.py uses add_col_params and del_col_params as the field names. There is no col_params field. FastAPI will set add_col_params and del_col_params to None and return a 400 because the endpoint handler checks for those fields and raises HTTPException(400, "Column parameters required"). Tests test_add_column_with_legacy_col_params_returns_400 and test_delete_column_with_legacy_col_params_returns_400 explicitly confirm the backend rejects col_params. This means right-clicking to add or delete any column via the context menu silently fails for all users.
Fix: replace col_params with add_col_params in handleAddColumn and del_col_params in handleDeleteColumn.
Steps to Reproduce:
- Open any project in the workspace.
- Right-click any column header to open the context menu.
- Click "Add Column", enter a name, and submit — OR click "Delete Column".
- Observe: a toast error appears ("Failed to add column" / "Failed to delete column") and the table is unchanged.
Expected Behaviour:
The column should be added or deleted immediately, and the table should update to reflect the change.
Screenshots: