keon94 commented on code in PR #2215:
URL: https://github.com/apache/incubator-devlake/pull/2215#discussion_r911626639


##########
helpers/e2ehelper/data_flow_tester.go:
##########
@@ -174,24 +187,51 @@ func (t *DataFlowTester) Subtask(subtaskMeta 
core.SubTaskMeta, taskData interfac
 }
 
 func (t *DataFlowTester) getPkFields(dst schema.Tabler) []string {
+       return t.getFields(dst, func(column gorm.ColumnType) bool {
+               isPk, _ := column.PrimaryKey()
+               return isPk
+       })
+}
+
+func filterColumn(column gorm.ColumnType, opts TableOptions) bool {
+       for _, ignore := range opts.IgnoreFields {
+               if column.Name() == ignore {
+                       return false
+               }
+       }
+       if len(opts.TargetFields) == 0 {
+               return true
+       }
+       targetFound := false
+       for _, target := range opts.TargetFields {
+               if column.Name() == target {
+                       targetFound = true
+                       break
+               }
+       }
+       return targetFound
+}
+
+func (t *DataFlowTester) getFields(dst schema.Tabler, filter func(column 
gorm.ColumnType) bool) []string {
        columnTypes, err := t.Db.Migrator().ColumnTypes(dst)
        var pkFields []string

Review Comment:
   yep, must've been from copy-paste. good catch



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to