go-gota / gota

Gota: DataFrames and data wrangling in Go (Golang)
Other
2.98k stars 276 forks source link

findType panics on empty string #87

Closed durp closed 4 years ago

durp commented 5 years ago

given: arr = []string{""}

func findType(arr []string) series.Type {
    var hasFloats, hasInts, hasBools, hasStrings bool
    for _, str := range arr {
        if str == "" || str == "NaN" {
            continue
        }

panics because the loop continues without setting a type... Is this the intended behavior? Or should hasStrings be set for "" | "NaN" ? Or is there a missing case?

danicat commented 5 years ago

I believe this should be solved by #91. If you please could test with the latest version of the dev branch and get back to us it would be very helpful.