Repository navigation
Conversation
This branch has not been deployed
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
A dataset whose upload failed keeps an empty
file_path, andPath("")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
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 existsDashAI/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 filesDashAI/back/api/api_v1/endpoints/data_documents.py: refuses to save a document notebook whose working copy is goneDashAI/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 filesDashAI/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 folderstests/back/api/*,tests/back/core/test_stored_paths.py: cover failed, empty and missing stored paths for notebooks, copies, converters and exportsTesting (optional)
datasetsin the DashAI data folder.