feat: Implement data download functionality and enhance datastore methods#49
Open
vsaravind01 wants to merge 4 commits intomainfrom
Open
feat: Implement data download functionality and enhance datastore methods#49vsaravind01 wants to merge 4 commits intomainfrom
vsaravind01 wants to merge 4 commits intomainfrom
Conversation
- Added `_download_data` function to retrieve file path and metadata for downloading data from the datastore. - Introduced `get_info` method in `DataStore` and `DiskDataStore` classes to fetch object information. - Updated FastAPI router to include a new endpoint for downloading data, handling both files and directories. - Added tests for the new download functionality and datastore methods to ensure proper behavior and error handling.
- Updated `disk_datastore` and `alternate_disk_datastore` fixtures to instantiate `DiskDataStore` directly instead of using the `_init_datastore` utility. - Modified test cases in `test_utils.py` to pass the `disk_datastore` fixture to the `_download_data` function, ensuring proper integration with the new datastore structure.
- Updated the _download_data function to include an optional datastore parameter, allowing for more flexible data retrieval. - Adjusted the internal logic to initialize the datastore only if it is not provided, improving usability and integration with existing datastore structures.
ARY2260
reviewed
Nov 19, 2025
| os.remove(zip_base + ".zip") | ||
| raise HTTPException(status_code=500, detail=f"Failed to create zip file: {str(e)}") | ||
| else: | ||
| # For single file models (unlikely but handle it) |
Collaborator
There was a problem hiding this comment.
can you please elaborate?
Collaborator
Author
There was a problem hiding this comment.
If the model is not a directory and if it is a single file we should be able to handle this case as well. That's the reason why I've explicitly mentioned that it's unlikely but we still handle it.
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.
_download_datafunction to retrieve file path and metadata for downloading data from the datastore.get_infomethod inDataStoreandDiskDataStoreclasses to fetch object information.Type of change
Please check the option that is related to your PR.
Checklist
lint.shand ensure that it passes (Use./lint.sh --fixto fix formatting issues automatically)