File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 1+ from suzieq .shared .poller_error_codes import SqPollerStatusCode
12from suzieq .engines .pandas .engineobj import SqPandasEngine
23
34
@@ -53,6 +54,9 @@ def get(self, **kwargs):
5354 if not df .empty and add_filter :
5455 df = df .query (add_filter ).reset_index (drop = True )
5556
57+ if 'statusStr' in fields :
58+ df ['statusStr' ] = df .status .apply (self ._get_status_str )
59+
5660 return df .reset_index (drop = True )[fields ]
5761
5862 def summarize (self , ** kwargs ):
@@ -72,3 +76,12 @@ def summarize(self, **kwargs):
7276 ]
7377
7478 return super ().summarize (** kwargs )
79+
80+ @staticmethod
81+ def _get_status_str (code : int ) -> str :
82+ '''Function to catch exception'''
83+ try :
84+ # pylint: disable=no-value-for-parameter
85+ return SqPollerStatusCode (code ).errstr
86+ except ValueError :
87+ return f'{ code } '
You can’t perform that action at this time.
0 commit comments