MCPcopy Create free account
hub / github.com/sql-machine-learning/sqlflow / hasUnknownParameters

Function hasUnknownParameters

go/codegen/pai/codegen_test.go:83–93  ·  view source on GitHub ↗
(code string, list []string)

Source from the content-addressed store, hash-verified

81}
82
83func hasUnknownParameters(code string, list []string) bool {
84 r := regexp.MustCompile(`(?s)((?:\b_predict\(|\bpred\(|\btrain\().*)`)
85 c := r.FindStringSubmatch(code)[1]
86 r = regexp.MustCompile(`[(\s,](\w+)=.*,`)
87 for _, v := range r.FindStringSubmatch(c)[1:] {
88 if !contains(list, v) {
89 return true
90 }
91 }
92 return false
93}
94
95func mockClusterConfig() *ClusterConfig {
96 return &ClusterConfig{

Callers 2

TestTrainCodegenFunction · 0.85
TestPredictCodegenFunction · 0.85

Calls 1

containsFunction · 0.70

Tested by

no test coverage detected