From ed65077affcfa41cf2955ebdea154e57c1fd8841 Mon Sep 17 00:00:00 2001 From: Nick Moore Date: Tue, 17 Oct 2023 15:08:09 +1100 Subject: [PATCH] code tidying --- countess/plugins/python.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/countess/plugins/python.py b/countess/plugins/python.py index 37c29be..9306a6f 100644 --- a/countess/plugins/python.py +++ b/countess/plugins/python.py @@ -1,5 +1,5 @@ -from types import CodeType import builtins +from types import CodeType import pandas as pd @@ -20,12 +20,12 @@ SAFE_BUILTINS = { x: builtins.__dict__[x] - for x in - "abs all any ascii bin bool bytearray bytes chr complex dict divmod enumerate " - "filter float format frozenset hash hex id int len list map max min oct " - "ord pow range reversed round set slice sorted str sum tuple type zip".split() + for x in "abs all any ascii bin bool bytearray bytes chr complex dict divmod " + "enumerate filter float format frozenset hash hex id int len list map max min " + "oct ord pow range reversed round set slice sorted str sum tuple type zip".split() } + class PythonPlugin(PandasTransformDictToDictPlugin): name = "Python Code" description = "Apply python code to each row." @@ -44,7 +44,6 @@ class PythonPlugin(PandasTransformDictToDictPlugin): code_object = None - def process_dict(self, data: dict, logger: Logger): assert isinstance(self.parameters["code"], TextParam) assert isinstance(self.parameters["columns"], PerColumnArrayParam)