Skip to content

Fix notebook save empty dataset - #749

Merged
cristian-tamblay merged 2 commits into
developfrom
fix/notebook-save-empty-dataset
Jul 6, 2026
Merged

Fix notebook save empty dataset#749
cristian-tamblay merged 2 commits into
developfrom
fix/notebook-save-empty-dataset

Conversation

@Creylay

@Creylay Creylay commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

Saving a dataset from a notebook after removing all columns via converters caused a crash in the backend job (KeyError, ZeroDivisionError) because compute_metadata iterated over stale column type metadata that no longer matched the actual dataframe. The root cause was that remove_columns in DashAIDataset removed columns from the data but never updated self.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

  • Backend change
  • Frontend change
  • CI / Workflow change
  • Build / Packaging change
  • Bug fix
  • Documentation

Changes (by file)

  • DashAI/back/dataloaders/classes/dashai_dataset.py: fixed remove_columns to also remove deleted columns from self.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_metadata to handle dataframes whose columns no longer match the stored type metadata.
  • DashAI/front/src/components/notebooks/notebook/DatasetPreviewNotebook.jsx: added totalRows state that re-fetches the row count after each converter change; passes hasNoColumns to SaveDatasetModal when the result has 0 rows.
  • DashAI/front/src/components/notebooks/datasetCreation/SaveDatasetModal.jsx: added hasNoColumns prop that disables the submit button and shows an error message when the dataset is empty.
  • DashAI/front/src/utils/i18n/locales/*/datasets.json: added error.cannotSaveEmptyDataset translation key in all five languages.

Testing

  • Apply a ColumnRemover converter that removes all columns from a notebook, then open "Save as New Dataset". The submit button should be disabled with an error message.
  • Apply converters that only remove some columns, save should proceed normally.

@Creylay Creylay added bug Something isn't working front Frontend work back Backend work labels Jun 30, 2026
@cristian-tamblay
cristian-tamblay merged commit 9d5b714 into develop Jul 6, 2026
20 checks passed
@cristian-tamblay
cristian-tamblay deleted the fix/notebook-save-empty-dataset branch July 6, 2026 16:59
@cristian-tamblay cristian-tamblay mentioned this pull request Aug 6, 2026
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

back Backend work bug Something isn't working front Frontend work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants