Skip to content

Commit

Permalink
rename parent event columns
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud Van der Poorten committed Dec 20, 2024
1 parent 3b79910 commit 7bcab69
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/datasource/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func EventQueryResultToTrendDataFrame(includeParentInfo bool, assets []schemas.A
if includeParentInfo && events[i].Parent != nil {
parentEvent := *events[i].Parent
parentType := eventTypes[parentEvent.EventTypeUUID]
parentPrefix := parentType.Name + "_"
parentPrefix := "ParentEvent_"

Check failure on line 150 in pkg/datasource/events.go

View workflow job for this annotation

GitHub Actions / Build, lint and unit tests

string `ParentEvent_` has 3 occurrences, make it a constant (goconst)

// Add parent event details
labels[parentPrefix+EventUUIDColumnName] = parentEvent.UUID.String()
Expand Down Expand Up @@ -433,12 +433,12 @@ func dataFrameForEventType(includeParentInfo bool, assets []schemas.Asset, event
if events[i].ParentUUID != nil {
if includeParentInfo {
parentEvent := *events[i].Parent
parentEventType, parentEventTypeExists := eventTypes[parentEvent.EventTypeUUID]
_, parentEventTypeExists := eventTypes[parentEvent.EventTypeUUID]
if !parentEventTypeExists {
continue
}

parentPrefix := parentEventType.Name + "_"
parentPrefix := "ParentEvent_"
if !parentFieldsAdded[parentPrefix] {
parentFieldsAdded[parentPrefix] = true

Expand Down Expand Up @@ -502,7 +502,7 @@ func dataFrameForEventType(includeParentInfo bool, assets []schemas.Asset, event
if _, ok := eventTypes[events[i].Parent.EventTypeUUID]; ok {
parentEvent := *events[i].Parent
parentEventType := eventTypes[parentEvent.EventTypeUUID]
parentPrefix := parentEventType.Name + "_"
parentPrefix := "ParentEvent_"

fillFields(parentPrefix, fieldByColumn, &parentEvent, uuidToAssetMap, parentEventType, eventTypePropertiesForEventType[parentEvent.EventTypeUUID])

Expand Down

0 comments on commit 7bcab69

Please sign in to comment.