Skip to content

Commit

Permalink
Add default blocking keys in resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyashankar committed Sep 3, 2024
1 parent 2011af2 commit 7caed2c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions motion/operations/resolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down

0 comments on commit 7caed2c

Please sign in to comment.