Skip to content

Commit

Permalink
revert arg default behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
calgray committed May 18, 2022
1 parent 5bcd6c3 commit a321ee1
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions daliuge-engine/dlg/apps/pyfunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,6 @@ def initialize(self, **kwargs):
"""
BarrierAppDROP.initialize(self, **kwargs)

# TODO: for some reason the literal is never cast?
self.input_parser = DropParser(self.input_parser)
self.output_parser = DropParser(self.output_parser)

self._applicationArgs = self._getArg(kwargs, "applicationArgs", {})

self.func_code = self._getArg(kwargs, "func_code", None)
Expand Down Expand Up @@ -401,7 +397,9 @@ def run(self):
elif DropParser(self.input_parser) is DropParser.DATAURL:
all_contents = lambda x: x.dataurl
else:
raise ValueError(self.input_parser.__repr__())
all_contents = lambda x: ast.literal_eval(
droputils.allDropContents(x).decode("utf-8")
)

inputs = collections.OrderedDict()
for uid, drop in self._inputs.items():
Expand Down Expand Up @@ -559,10 +557,8 @@ def write_results(self, result):
if DropParser(self.output_parser) is DropParser.PICKLE:
logger.debug(f"Writing pickeled result {type(r)} to {o}")
o.write(pickle.dumps(r))
elif DropParser(self.output_parser) is DropParser.AST:
o.write(repr(r).encode('utf-8'))
else:
ValueError(self.output_parser.__repr__())
o.write(repr(r).encode('utf-8'))

def generate_recompute_data(self):
return self._recompute_data

0 comments on commit a321ee1

Please sign in to comment.