build(agent): new-agents-3#dd492b iteration
This commit is contained in:
parent
895f41d19a
commit
6e8f5c02dc
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue