Fixed #22434 -- Used Query.can_filter() to check for slice