Open
Conversation
Contributor
There was a problem hiding this comment.
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.
DashAI/front/src/components/notebooks/datasetCreation/ConfigureAndUploadDatasetStep.jsx
Outdated
Show resolved
Hide resolved
DashAI/front/src/components/notebooks/datasetCreation/PreviewDatasetTable.jsx
Show resolved
Hide resolved
DashAI/front/src/components/notebooks/datasetCreation/PreviewDatasetTable.jsx
Show resolved
Hide resolved
DashAI/front/src/components/notebooks/dataset/EditableColumnHeader.jsx
Outdated
Show resolved
Hide resolved
DashAI/front/src/components/notebooks/dataset/EditableColumnHeader.jsx
Outdated
Show resolved
Hide resolved
DashAI/front/src/components/notebooks/datasetCreation/PreviewDatasetTable.jsx
Outdated
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.