is_not_null_compare.py 518 B

123456789101112131415161718192021
  1. # coding=utf-8
  2. """
  3. @project: maxkb
  4. @Author:虎
  5. @file: is_not_null_compare.py
  6. @date:2024/6/28 10:45
  7. @desc:
  8. """
  9. from typing import List
  10. from application.flow.compare import Compare
  11. class IsNotNullCompare(Compare):
  12. def support(self, node_id, fields: List[str], source_value, compare, target_value):
  13. if compare == 'is_not_null':
  14. return True
  15. def compare(self, source_value, compare, target_value):
  16. return source_value is not None and len(source_value) > 0