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')
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
def _map_item(self, it): context = create_context(item=it) return self.interpreter.eval(expression=self.map_expression, context=context)