Example #1
0
 def filter(self, item):
     try:
         context = create_context(item=item, **self.imports)
         return self.interpreter.eval(self.expression, context=context)
     except Exception as ex:
         self.logger.error(str(ex))
         raise
 def filter(self, item):
     try:
         context = create_context(item=item, **self.imports)
         return self.interpreter.eval(self.expression, context=context)
     except Exception as ex:
         self.logger.error(str(ex))
         raise
 def transform_batch(self, batch):
     for item in batch:
         context = create_context(item=item)
         for expression in self.python_expressions:
             self.interpreter.eval(expression, context=context)
         yield item
     self.logger.debug('Transformed items')
Example #4
0
 def transform_batch(self, batch):
     for item in batch:
         context = create_context(item=item)
         for expression in self.python_expressions:
             self.interpreter.eval(expression, context=context)
         yield item
     self.logger.debug('Transformed items')
 def _get_membership(self, item):
     try:
         context = create_context(item=item)
         return [
             self.interpreter.eval(expression, context=context)
             for expression in self.expressions
         ]
     except Exception as ex:
         self.logger.error(str(ex))
         raise
Example #6
0
 def _get_membership(self, item):
     try:
         context = create_context(item=item)
         return [
             self.interpreter.eval(expression, context=context)
             for expression in self.expressions
         ]
     except Exception as ex:
         self.logger.error(str(ex))
         raise
Example #7
0
 def _map_item(self, it):
     context = create_context(item=it)
     return self.interpreter.eval(expression=self.map_expression, context=context)
Example #8
0
 def _map_item(self, it):
     context = create_context(item=it)
     return self.interpreter.eval(expression=self.map_expression,
                                  context=context)