Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

fix: import dataset from google sheet bug #23

Merged
merged 3 commits into from
Jul 14, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion pkg/dataset/csvparser.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"errors"
"io"
"strconv"
"strings"

"github.com/reearth/reearth-backend/pkg/id"
)
Expand Down Expand Up @@ -87,7 +88,7 @@ func (p *DatasetCSVParser) GuessSchema(sid id.SceneID) error {
if h == "lng" {
haslng = true
}
if h != "lng" && h != "lat" {
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)
Expand Down