-
Notifications
You must be signed in to change notification settings - Fork 12
Feat rename columns #442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Feat rename columns #442
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request implements a column renaming feature that allows users to rename dataset columns before upload (in preview) and after upload (in dataset view) via double-click interaction.
Changes:
- Added frontend UI components for inline column renaming with validation
- Implemented backend API endpoint to rename columns in existing datasets
- Added support for column renames during dataset upload process
- Included i18n translations for rename-related messages
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| DashAI/front/src/utils/i18n/locales/es/common.json | Added Spanish translations for column rename feature |
| DashAI/front/src/utils/i18n/locales/en/common.json | Added English translations for column rename feature |
| DashAI/front/src/components/notebooks/datasetCreation/Upload.jsx | Added onColumnRename prop to forward rename callbacks |
| DashAI/front/src/components/notebooks/datasetCreation/PreviewDatasetTable.jsx | Implemented inline column renaming in preview table with local state management |
| DashAI/front/src/components/notebooks/datasetCreation/PreviewDataset.jsx | Added handleColumnRename callback wrapper to propagate renames |
| DashAI/front/src/components/notebooks/datasetCreation/ConfigureAndUploadDatasetStep.jsx | Track column renames with useRef and pass to backend during upload |
| DashAI/front/src/components/notebooks/dataset/tabs/OverviewTab.jsx | Enable editable columns in dataset overview table |
| DashAI/front/src/components/notebooks/dataset/EditableColumnHeader.jsx | New component providing editable header with validation and error handling |
| DashAI/front/src/components/notebooks/dataset/DatasetTable.jsx | Integrated EditableColumnHeader and handleColumnRename with API call |
| DashAI/front/src/components/datasets/DatasetModal.jsx | Handle column renames in modal by updating columnsSpec and previewData |
| DashAI/front/src/components/DatasetVisualization.jsx | Minor cleanup removing comments |
| DashAI/front/src/api/datasets.ts | Added renameDatasetColumn API function |
| DashAI/back/job/dataset_job.py | Process column_renames parameter during dataset upload |
| DashAI/back/api/api_v1/schemas/datasets_params.py | Added DatasetRenameColumnParams schema |
| DashAI/back/api/api_v1/endpoints/datasets.py | Implemented PATCH endpoint for renaming columns with validation and file updates |
Comments suppressed due to low confidence (1)
DashAI/front/src/components/datasets/DatasetModal.jsx:182
- Data type inference loses column renames: The handleInferDataTypes function (line 182) replaces the entire columnsSpec state with the inferred types. This will lose any column renames that were made before inference. After a user renames columns and then runs type inference, the renamed columns will revert to their original names. The updatedTypes should preserve renamed column names by mapping them correctly.
const handleInferDataTypes = async (methods) => {
setLoading(true);
const formData = new FormData();
formData.append("file", newDataset.file);
formData.append(
"params",
JSON.stringify({
...newDataset.params,
methods,
}),
);
try {
const response = await inferDataTypes(formData);
const updatedTypes = Object.fromEntries(
Object.entries(response).map(([key, value]) => [
key,
{
type: value.type,
dtype: value.dtype,
},
]),
);
setColumnsSpec(updatedTypes);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Now you can rename columns in preview before upload a dataset and in the dataset view, to change it you have to double click in the name of the columns.