Skip to content

Commit

Permalink
scheduler: Make task_list() search case-insensitive (#3157)
Browse files Browse the repository at this point in the history
This matches the behaviour of the frontend.
  • Loading branch information
arteymix committed Apr 28, 2022
1 parent 5a69669 commit 4c3f38b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion luigi/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1442,7 +1442,7 @@ def filter_func(_):
terms = search.split()

def filter_func(t):
return all(term in t.pretty_id for term in terms)
return all(term.casefold() in t.pretty_id.casefold() for term in terms)

tasks = self._state.get_active_tasks_by_status(status) if status else self._state.get_active_tasks()
for task in filter(filter_func, tasks):
Expand Down
2 changes: 2 additions & 0 deletions test/scheduler_api_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1774,6 +1774,8 @@ def test_task_list_filter_by_multiple_search_terms(self):
self.add_task('ClassA', day='2016-02-01', val='5')

self.search_pending('ClassA 2016-02-01 num', {expected})
# ensure that the task search is case insensitive
self.search_pending('classa 2016-02-01 num', {expected})

def test_upstream_beyond_limit(self):
sch = Scheduler(max_shown_tasks=3)
Expand Down

0 comments on commit 4c3f38b

Please sign in to comment.