diff --git a/motion/operations/resolve.py b/motion/operations/resolve.py index de14c6c7..9b24ebf4 100644 --- a/motion/operations/resolve.py +++ b/motion/operations/resolve.py @@ -187,16 +187,19 @@ def execute(self, input_data: List[Dict]) -> Tuple[List[Dict], float]: The method also calculates and logs statistics such as comparisons saved by blocking and self-join selectivity. """ + if len(input_data) == 0: + return [], 0 + blocking_keys = self.config.get("blocking_keys", []) blocking_threshold = self.config.get("blocking_threshold") blocking_conditions = self.config.get("blocking_conditions", []) input_schema = self.config.get("input", {}).get("schema", {}) + if not blocking_keys: + # Set them to all keys in the input data + blocking_keys = list(input_data[0].keys()) limit_comparisons = self.config.get("limit_comparisons") total_cost = 0 - if len(input_data) == 0: - return [], 0 - def is_match(item1: Dict[str, Any], item2: Dict[str, Any]) -> bool: return any( eval(condition, {"input1": item1, "input2": item2})