Skip to content

Commit 4aa1c81

Browse files
committed
pandas/devconfig: apply query_str when section is not specified
Signed-off-by: LucaNicosia <[email protected]>
1 parent be27341 commit 4aa1c81

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

suzieq/engines/pandas/devconfig.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ def get(self, **kwargs):
2121
query_str = kwargs.pop('query_str', '')
2222

2323
df = super().get(columns=columns, **kwargs)
24-
if df.empty or 'error' in df.columns or not section:
24+
if df.empty or 'error' in df.columns:
25+
return df
26+
27+
if not section:
28+
if query_str:
29+
df = df.query(query_str).reset_index(drop=True)
2530
return df
2631

2732
devdf = self._get_table_sqobj('device') \

0 commit comments

Comments
 (0)