Skip to content

[Bug] Table context menu always fails to add or delete columns #257

@alikhere

Description

@alikhere

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:

  1. Open any project in the workspace.
  2. Right-click any column header to open the context menu.
  3. Click "Add Column", enter a name, and submit — OR click "Delete Column".
  4. 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:

dataloom.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions