Skip to content

Commit

Permalink
a few improvements to the associated_with entries
Browse files Browse the repository at this point in the history
  • Loading branch information
caffix committed Oct 18, 2024
1 parent 5fcdc7e commit 9f30a03
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions engine/plugins/horizontals/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,18 @@ func (h *horizPlugin) addAssociatedRelationship(e *et.Event, assocs []*scope.Ass
}

func (h *horizPlugin) makeAssocRelationshipEntries(e *et.Event, assoc, assoc2 *dbt.Asset) {
// do not connect an asset to itself
if assoc.ID == assoc2.ID {
return
}
// check that this relationship has not already been setup during this session
if rels, hit := e.Session.Cache().GetOutgoingRelations(assoc, "associated_with"); hit && len(rels) > 0 {
for _, rel := range rels {
if rel.ToAsset.ID == assoc2.ID {
return
}
}
}

now := time.Now()
e.Session.Cache().SetRelation(&dbt.Relation{
Expand Down

0 comments on commit 9f30a03

Please sign in to comment.