Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: DEV-2266: Tasks ordered by file names on import #2337

Merged
merged 1 commit into from May 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion label_studio/io_storages/localfiles/models.py
Expand Up @@ -59,7 +59,9 @@ def can_resolve_url(self, url):
def iterkeys(self):
path = Path(self.path)
regex = re.compile(str(self.regex_filter)) if self.regex_filter else None
for file in path.rglob('*'):
# For better control of imported tasks, file reading has been changed to ascending order of filenames.
# In other words, the task IDs are sorted by filename order.
for file in sorted(path.rglob('*'), key=os.path.basename):
if file.is_file():
key = file.name
if regex and not regex.match(key):
Expand Down