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

Make task search case insensitive to match the frontend behaviour #3157

Merged
merged 2 commits into from
Apr 28, 2022
Merged
Show file tree
Hide file tree
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
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