Skip to content

Commit

Permalink
fix: DEV-2266: Tasks ordered by file names on import (HumanSignal#2337)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikbuch authored May 12, 2022
1 parent 6b9a7fb commit 7e0a16b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion label_studio/io_storages/localfiles/models.py
Original file line number Diff line number Diff line change
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

0 comments on commit 7e0a16b

Please sign in to comment.