Fix notebook save empty dataset - #749
Merged
Merged
Conversation
… in multiple languages
…ages in multiple languages
cristian-tamblay
approved these changes
Jul 6, 2026
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.
Summary
Saving a dataset from a notebook after removing all columns via converters caused a crash in the backend job (
KeyError,ZeroDivisionError) becausecompute_metadataiterated over stale column type metadata that no longer matched the actual dataframe. The root cause was thatremove_columnsinDashAIDatasetremoved columns from the data but never updatedself.types, so the Arrow metadata on disk stayed out of sync. Additionally, the frontend offered no feedback — the save button remained active even with an empty result.Type of Change
Changes (by file)
DashAI/back/dataloaders/classes/dashai_dataset.py: fixedremove_columnsto also remove deleted columns fromself.types, keeping Arrow metadata in sync with the actual data; added early-return guards in_compute_numeric_metadata,_compute_categorical_metadata,_compute_correlations, and_compute_quality_metadatato handle dataframes whose columns no longer match the stored type metadata.DashAI/front/src/components/notebooks/notebook/DatasetPreviewNotebook.jsx: addedtotalRowsstate that re-fetches the row count after each converter change; passeshasNoColumnstoSaveDatasetModalwhen the result has 0 rows.DashAI/front/src/components/notebooks/datasetCreation/SaveDatasetModal.jsx: addedhasNoColumnsprop that disables the submit button and shows an error message when the dataset is empty.DashAI/front/src/utils/i18n/locales/*/datasets.json: addederror.cannotSaveEmptyDatasettranslation key in all five languages.Testing
ColumnRemoverconverter that removes all columns from a notebook, then open "Save as New Dataset". The submit button should be disabled with an error message.