From 532926ecb13b051c95d1b8cc23786ba34efc23ff Mon Sep 17 00:00:00 2001 From: Ya Ka Date: Tue, 13 Jul 2021 19:18:22 +0300 Subject: [PATCH 1/2] - ignore Column With Empty Label --- pkg/dataset/csvparser.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/dataset/csvparser.go b/pkg/dataset/csvparser.go index 2edb4338..0199cbb0 100644 --- a/pkg/dataset/csvparser.go +++ b/pkg/dataset/csvparser.go @@ -87,7 +87,7 @@ func (p *DatasetCSVParser) GuessSchema(sid id.SceneID) error { if h == "lng" { haslng = true } - if h != "lng" && h != "lat" { + if h != "lng" && h != "lat" && h != "" { t := p.getRecord(p.firstline[k]).Type() field, _ := NewSchemaField().NewID().Name(h).Type(t).Build() schemafields = append(schemafields, field) From e608c6e6474db1d02d8f8f18d6a7f5914541da46 Mon Sep 17 00:00:00 2001 From: Ya Ka Date: Tue, 13 Jul 2021 19:20:58 +0300 Subject: [PATCH 2/2] - ignore Column With Empty Label --- pkg/dataset/csvparser.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/dataset/csvparser.go b/pkg/dataset/csvparser.go index 0199cbb0..47348bf4 100644 --- a/pkg/dataset/csvparser.go +++ b/pkg/dataset/csvparser.go @@ -5,6 +5,7 @@ import ( "errors" "io" "strconv" + "strings" "github.com/reearth/reearth-backend/pkg/id" ) @@ -87,7 +88,7 @@ func (p *DatasetCSVParser) GuessSchema(sid id.SceneID) error { if h == "lng" { haslng = true } - if h != "lng" && h != "lat" && h != "" { + if h != "lng" && h != "lat" && strings.TrimSpace(h) != "" { t := p.getRecord(p.firstline[k]).Type() field, _ := NewSchemaField().NewID().Name(h).Type(t).Build() schemafields = append(schemafields, field)