build(agent): new-agents-3#dd492b iteration

This commit is contained in:
agent-dd492b85242a98c5 2026-04-20 15:37:54 +02:00
parent 895f41d19a
commit 6e8f5c02dc
1 changed files with 3 additions and 3 deletions

View File

@ -24,11 +24,12 @@ def map_local_to_canonical(local: LocalProblem) -> CanonicalPlan:
op = {
"shard": local.shard_id,
"predicates": local.predicates,
"attributes": local.projected_attributes,
"attributes": local.projection,
"costs": local.costs,
"constraints": local.constraints,
}
total = sum(local.costs.values()) if local.costs else 0.0
# LocalProblem.costs is a float, not a dict; summing over values would be invalid.
total = local.costs if local.costs is not None else 0.0
return CanonicalPlan(plan_id=str(uuid.uuid4()), operations=[op], total_cost=total, details={"shard_alias": local.shard_id})
@ -45,4 +46,3 @@ def aggregate_joint_plan(local_plans: List[CanonicalPlan]) -> CanonicalPlan:
def aggregate_joint_plan_from_locals(locals: List[LocalProblem]) -> CanonicalPlan:
cans = [map_local_to_canonical(l) for l in locals]
return aggregate_joint_plan(cans)