Skip to content

local data backend double-traversal fix - #2836

Merged
bghira merged 1 commit into
mainfrom
bugfix/local-fs-optim
Jul 17, 2026
Merged

local data backend double-traversal fix#2836
bghira merged 1 commit into
mainfrom
bugfix/local-fs-optim

Conversation

@bghira

@bghira bghira commented Jul 17, 2026

Copy link
Copy Markdown
Owner

This pull request refactors the list_files method in LocalDataBackend to improve file discovery, especially with symlinks and forbidden directories, and adds comprehensive unit tests to ensure correct behavior. The new implementation uses os.walk to traverse directories, prevents duplicate file listings due to symlink cycles, and excludes files in forbidden directories.

Refactor and bug fixes in file listing:

  • Rewrote the file discovery logic in list_files to use os.walk with symlink support, preventing duplicate files from symlink cycles and ensuring forbidden directories are pruned from traversal. [1] [2]

Testing improvements:

  • Added a new test suite TestLocalDataBackendListFiles in test_local_files.py to verify that:
    • Nested files are not duplicated.
    • Symlinked directories are followed without causing cycles.
    • Forbidden directories (like .ipynb_checkpoints) are properly excluded from results.

@bghira
bghira merged commit e6e4cdd into main Jul 17, 2026
2 checks passed
@bghira
bghira deleted the bugfix/local-fs-optim branch July 17, 2026 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant