Skip to content

Commit

Permalink
code tidying
Browse files Browse the repository at this point in the history
  • Loading branch information
nickzoic committed Oct 17, 2023
1 parent f92a48a commit ed65077
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions countess/plugins/python.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from types import CodeType
import builtins
from types import CodeType

import pandas as pd

Expand All @@ -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."
Expand All @@ -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)
Expand Down

0 comments on commit ed65077

Please sign in to comment.