Skip to content

Commit b3a965b

Browse files
committed
sqPoller eng: handle query-str correctly
Signed-off-by: Dinesh Dutt <[email protected]>
1 parent f503ef7 commit b3a965b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

suzieq/engines/pandas/sqPoller.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@ def get(self, **kwargs):
1717
poll_period_exceeded = kwargs.pop('pollExcdPeriodCount', '')
1818
columns = kwargs.pop('columns', [])
1919
addnl_fields = kwargs.pop('addnl_fields', [])
20+
user_query = kwargs.pop('query_str', '')
2021

2122
fields = self.schema.get_display_fields(columns)
23+
user_query_cols = self._get_user_query_cols(user_query)
24+
addnl_fields += [x for x in user_query_cols if x not in addnl_fields]
25+
2226
if status and 'status' not in fields:
2327
addnl_fields.append('status')
2428

@@ -51,12 +55,13 @@ def get(self, **kwargs):
5155
else:
5256
add_filter += f'{add_prefix}pollExcdPeriodCount == 0'
5357

54-
if not df.empty and add_filter:
55-
df = df.query(add_filter).reset_index(drop=True)
56-
5758
if 'statusStr' in fields:
5859
df['statusStr'] = df.status.apply(self._get_status_str)
5960

61+
if not df.empty and add_filter:
62+
df = df.query(add_filter).reset_index(drop=True)
63+
64+
df = self._handle_user_query_str(df, user_query)
6065
return df.reset_index(drop=True)[fields]
6166

6267
def summarize(self, **kwargs):

0 commit comments

Comments
 (0)