tbonelee commented on code in PR #5320:
URL: https://github.com/apache/zeppelin/pull/5320#discussion_r3610039745
##########
zeppelin-web-angular/src/app/visualizations/table/table-visualization.component.ts:
##########
@@ -209,7 +209,7 @@ export class TableVisualizationComponent implements OnInit {
sortTypes.push(value.sort);
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
- terms.push((row: any) => String(row[key]).search(value.term) !== -1);
+ terms.push((row: any) => String(row[key]).includes(value.term.trim()));
Review Comment:
Nice fix, `includes()` is the right call here.
One request before merging: `value.term.trim()` runs inside the per-row
predicate, so it re-executes for every row on each filter. Since it is the same
for all rows, please hoist it out:
```suggestion
const term = value.term.trim();
terms.push((row: any) => String(row[key]).includes(term));
```
Same behavior, just avoids the repeated `trim()` calls.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]