Skip to content

Commit

Permalink
Release4.58.0 fix source tree calculation for qualified property (#3150)
Browse files Browse the repository at this point in the history
Co-authored-by: Akash <[email protected]>
  • Loading branch information
AFine-gs and siaka-Akash authored Oct 3, 2024
1 parent 7105a05 commit c7df13e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2486,5 +2486,3 @@ Mapping meta::pure::graphFetch::tests::sourceTreeCalc::functionCaching::testMapp
b: $src.c.b.d->func3($src.s2).val2
}
)


Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,18 @@ function <<access.private>> meta::pure::lineage::scanProperties::dummyNodeForCla
^PropertyPathNode( class = $c, property= getDummyProperty());
}

function <<access.private>> meta::pure::lineage::scanProperties::findAndAddChildrenAtTheEnd(tree: PropertyPathTree[1], path: PropertyPathNode[*], toAdd: PropertyPathTree[*]):PropertyPathTree[1]
function meta::pure::lineage::scanProperties::findAndAddChildrenAtTheEnd(tree: PropertyPathTree[1], path: PropertyPathNode[*], toAdd: PropertyPathTree[*]):PropertyPathTree[1]
{
if($path->isEmpty(),
| ^$tree(children += $toAdd),
| let first = $path->at(0);
let correctTree = $tree.children->filter(x | $x.value->instanceOf(PropertyPathNode) && ($x.value->cast(@PropertyPathNode).property == $first.property))->toOne();
let otherTrees = $tree.children->remove($correctTree);
^$tree(
children = $otherTrees->concatenate($correctTree->findAndAddChildrenAtTheEnd($path->tail(), $toAdd))
let correctTree = $tree.children->filter(x | $x.value->instanceOf(PropertyPathNode) && ($x.value->cast(@PropertyPathNode).property == $first.property));
if($correctTree->isEmpty(),
|^$tree(children += $toAdd),
| let otherTrees = $tree.children->remove($correctTree->toOne());
^$tree(
children = $otherTrees->concatenate($correctTree->toOne()->findAndAddChildrenAtTheEnd($path->tail(), $toAdd))
);
);
)
}
Expand Down Expand Up @@ -788,8 +791,8 @@ function <<access.private>> meta::pure::lineage::scanProperties::recurse_inlineQ
{|
let qual = $p.value->cast(@PropertyPathNode).property->cast(@QualifiedProperty<Any>);
let qualifierTreeCurrent = $qual.expressionSequence->evaluateAndDeactivate()->toOne()->internal_scanProperties([], noVars(), $config,^Map<String,ScanPropertiesState>(), noDebug()).current;
let qualifierTree = $p.qualifierSubTree.children->toOne();
findAndAddChildrenAtTheEnd($qualifierTree, $qualifierTreeCurrent.values, $p.children).children;
let qualifierTree = $p.qualifierSubTree.children;
$qualifierTree->map(t | $t->findAndAddChildrenAtTheEnd($qualifierTreeCurrent.values, $p.children)).children;
}
)->map(nt| $nt->recurse_inlineQualifiedPropertyNodes($config));
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,4 +444,4 @@ Mapping meta::analytics::mapping::modelCoverage::test::sampleModelToModelMapping
~src meta::analytics::mapping::modelCoverage::test::Street
streetName: $src.streetName + '1'
}
)
)

0 comments on commit c7df13e

Please sign in to comment.