datachain icon indicating copy to clipboard operation
datachain copied to clipboard

Refactor file system source and path

Open ilongin opened this issue 1 year ago • 2 comments

Before, when listing local FS, we had root of the FS always set for source field, e.g file:/// and the rest was in path. Idea behind this was to utilize partial indexing and remove obsolete add_storage method. Now, when we are moving away from partial and bucket tables and moving indexing / listing to application level, we don't need this kind of setup as it was not convenient or intuitive.

With this changes when someone does DataStorage.from_storage("file:///home/ivan/animals/") we will have something like this in the listing table:

source path
file:///home/ivan/animals cats.jpg
file:///home/ivan/animals dogs/dog.jpg

This also adds re-indexing check in .from_storage() to avoid re-indexing if not needed. Old code related to that root of the FS mentioned at beginning of description was removed.

Note that some tests were skipped as it was not possible to refactor them without diving deep into other important task that will be worked on soon as well: https://github.com/iterative/datachain/issues/318

ilongin avatar Oct 07 '24 23:10 ilongin

Deploying datachain-documentation with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0864e6e
Status: ✅  Deploy successful!
Preview URL: https://96fa38ff.datachain-documentation.pages.dev
Branch Preview URL: https://ilongin-447-refactor-fs-sour.datachain-documentation.pages.dev

View logs

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 87.36%. Comparing base (dfd7fb4) to head (0864e6e). Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #496      +/-   ##
==========================================
- Coverage   87.49%   87.36%   -0.14%     
==========================================
  Files          97       97              
  Lines       10122    10136      +14     
  Branches     1382     1386       +4     
==========================================
- Hits         8856     8855       -1     
- Misses        909      923      +14     
- Partials      357      358       +1     
Flag Coverage Δ
datachain 87.30% <93.10%> (-0.16%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Oct 08 '24 13:10 codecov[bot]