Skip to content

Commit

Permalink
Remove instance of anti-pattern when type checking (LLNL#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelmckinsey1 authored Nov 8, 2023
1 parent 4d0b892 commit abbce4e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions thicket/tests/test_filter_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def check_filter_stats(th, columns_values):
for column in columns_values:
for value in columns_values[column]:
# for type str column
if type(value) == str:
if isinstance(value, str):
# expected nodes after applying filter
exp_nodes = sorted(
th.statsframe.dataframe.index[
Expand All @@ -19,7 +19,7 @@ def check_filter_stats(th, columns_values):
)
new_th = th.filter_stats(lambda x: x[column] == value)
# for type int column
elif type(value) == int:
elif isinstance(value, int):
exp_nodes = sorted(
th.statsframe.dataframe.index[
th.statsframe.dataframe[column] < value
Expand Down

0 comments on commit abbce4e

Please sign in to comment.