Skip to content

Commit

Permalink
More
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-artie committed May 2, 2024
1 parent 6e344b8 commit d62b54d
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions lib/destination/dml/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,9 @@ func (m *MergeArgument) Valid() error {
}

func removeDeleteColumnMarker(columns []string) ([]string, error) {
var removed bool
columns = slices.DeleteFunc(columns, func(col string) bool {
if col == constants.DeleteColumnMarker {
removed = true
return true
}
return false
})
if !removed {
origLength := len(columns)
columns = slices.DeleteFunc(columns, func(col string) bool { return col == constants.DeleteColumnMarker })
if len(columns) == origLength {
return nil, errors.New("artie delete flag doesn't exist")
}
return columns, nil
Expand Down

0 comments on commit d62b54d

Please sign in to comment.