Skip to content

Refuse notebooks and copies from datasets without stored files - #1073

Open
Irozuku wants to merge 8 commits into
developfrom
fix/notebook-from-failed-dataset
Open

Irozuku wants to merge 8 commits into
developfrom
fix/notebook-from-failed-dataset

Conversation

@Irozuku

@Irozuku Irozuku commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

A dataset whose upload failed keeps an empty file_path, and Path("") is the backend's working directory, so creating a notebook from it copied the whole working directory into a new folder under datasets. Every copy from a stored path now goes through one helper that refuses empty, relative or missing paths before anything is written, and notebooks, dataset copies, converter restores and exports answer with a clear error instead.


Type of Change

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

Changes (by file)

  • DashAI/back/core/stored_paths.py: new helpers that check a stored path and copy from it only when it is absolute and exists
  • DashAI/back/api/api_v1/endpoints/notebook.py: refuses notebooks from datasets or documents that did not finish loading or have no stored files ("Dataset is not ready", "Document is not ready")
  • DashAI/back/api/api_v1/endpoints/datasets.py: refuses to copy a dataset without stored files
  • DashAI/back/api/api_v1/endpoints/data_documents.py: refuses to save a document notebook whose working copy is gone
  • DashAI/back/api/api_v1/endpoints/converters.py, DashAI/back/dataloaders/classes/notebook_data.py: deleting a converter keeps the working copy and answers 409 when the notebook source has no stored files
  • DashAI/back/session_package/export.py, DashAI/back/model_package/export.py, DashAI/back/generative_package/export.py: refuse exports whose dataset or model files are gone and copy only from stored folders
  • tests/back/api/*, tests/back/core/test_stored_paths.py: cover failed, empty and missing stored paths for notebooks, copies, converters and exports

Testing (optional)

  • Upload a dataset that fails to load (for example a broken JSON file with the JSON dataloader) so it ends in Error, then create a notebook from it: the app shows "Error creating notebook" and no new folder appears under datasets in the DashAI data folder.
  • Create a notebook from a dataset that loaded fine: it opens with its data as before.

@Irozuku Irozuku added bug Something isn't working back Backend work labels Dec 4, 2026

This branch has not been deployed

No deployments
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant