{"action":"created","issue":{"url":"https://api.github.com/repos/attic-labs/noms/issues/2490","repository_url":"https://api.github.com/repos/attic-labs/noms","labels_url":"https://api.github.com/repos/attic-labs/noms/issues/2490/labels{/name}","comments_url":"https://api.github.com/repos/attic-labs/noms/issues/2490/comments","events_url":"https://api.github.com/repos/attic-labs/noms/issues/2490/events","html_url":"https://github.com/attic-labs/noms/issues/2490","id":174410446,"number":2490,"title":"CLI tour csv-import fails","user":{"login":"vsivsi","id":428642,"avatar_url":"https://avatars.githubusercontent.com/u/428642?v=3","gravatar_id":"","url":"https://api.github.com/users/vsivsi","html_url":"https://github.com/vsivsi","followers_url":"https://api.github.com/users/vsivsi/followers","following_url":"https://api.github.com/users/vsivsi/following{/other_user}","gists_url":"https://api.github.com/users/vsivsi/gists{/gist_id}","starred_url":"https://api.github.com/users/vsivsi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vsivsi/subscriptions","organizations_url":"https://api.github.com/users/vsivsi/orgs","repos_url":"https://api.github.com/users/vsivsi/repos","events_url":"https://api.github.com/users/vsivsi/events{/privacy}","received_events_url":"https://api.github.com/users/vsivsi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-01T00:31:20Z","updated_at":"2016-09-01T04:39:52Z","closed_at":null,"body":"Hi! noms seems like a very cool and useful project, but I ran into difficulties almost immediately when running through the CLI tour. \r\n\r\nI installed and built noms per the instructions on the install page.\r\n\r\nEverything in the tour works great until the `noms sync` section.  Then this:\r\n\r\n```sh\r\n> noms sync http://demo.noms.io/cli-tour::sf-film-locations /tmp/noms::films\r\n> noms ds /tmp/noms\r\nfilms\r\n\r\n# So far so good...\r\n\r\n> go install github.com/attic-labs/noms/samples/go/csv/...\r\n> csv-export /tmp/noms::films > /tmp/film-locations.csv\r\n\r\n# Great!  Now make no edits and just re-import...\r\n\r\n> csv-import --column-types=String,String,String,String,String,String,String,Number,String,String,String \\\r\n    /tmp/film-locations.csv /tmp/noms::films\r\n\r\n        Error Trace:    s)...panic: \r\n        Error:\t\tError parsing value for column 'Age': Could not parse ' 49' into number (strconv.ParseFloat: parsing \" 49\": invalid syntax)\r\n\r\ngoroutine 1 [running]:\r\npanic(0x30d9a0, 0xc42117c8b0)\r\n\t/usr/local/Cellar/go/1.7/libexec/src/runtime/panic.go:500 +0x1a1\r\ngithub.com/attic-labs/noms/go/d.panicker.Errorf(0x397c5a, 0x21, 0xc420114ed0, 0x3, 0x3)\r\n\t/Users/vsi/work/src/github.com/attic-labs/noms/go/d/try.go:26 +0xa6\r\ngithub.com/attic-labs/noms/go/d.(*panicker).Errorf(0x555908, 0x397c5a, 0x21, 0xc420114ed0, 0x3, 0x3)\r\n\t<autogenerated>:2 +0x7e\r\ngithub.com/attic-labs/noms/vendor/github.com/attic-labs/testify/assert.Fail(0x516b80, 0x555908, 0xc4200b4300, 0x7b, 0x0, 0x0, 0x0, 0xc42117e000)\r\n\t/Users/vsi/work/src/github.com/attic-labs/noms/vendor/github.com/attic-labs/testify/assert/assertions.go:225 +0x510\r\ngithub.com/attic-labs/noms/vendor/github.com/attic-labs/testify/assert.(*Assertions).Fail(0xc420078550, 0xc4200b4300, 0x7b, 0x0, 0x0, 0x0, 0x7b)\r\n\t/Users/vsi/work/src/github.com/attic-labs/noms/vendor/github.com/attic-labs/testify/assert/assertion_forward.go:101 +0x69\r\ngithub.com/attic-labs/noms/samples/go/csv.readFieldsFromRow(0xc42117a440, 0x3, 0x4, 0xc420077400, 0x3, 0x4, 0xc4201030e0, 0x3, 0x3, 0xc42117c538, ...)\r\n\t/Users/vsi/work/src/github.com/attic-labs/noms/samples/go/csv/read.go:144 +0x2fe\r\ngithub.com/attic-labs/noms/samples/go/csv.ReadToList(0xc42011a5a0, 0x38d43c, 0x3, 0xc420077400, 0x3, 0x4, 0xc420112787, 0x3, 0x3, 0x6bdaa0, ...)\r\n\t/Users/vsi/work/src/github.com/attic-labs/noms/samples/go/csv/read.go:103 +0x23f\r\nmain.main()\r\n\t/Users/vsi/work/src/github.com/attic-labs/noms/samples/go/csv/csv-import/importer.go:158 +0xb8f\r\n```\r\n\r\nBOOM!\r\n\r\nThe problem appears to be related to improper quoting of strings in the second line of the exported CSV:\r\n\r\n```sh\r\n> head -n 2 /tmp/film-locations.csv\r\nActor1,Actor2,Actor3,Director,Distributor,FunFacts,Locations,ProductionCompany,ReleaseYear,Title,Writer\r\nSiddarth,Nithya Menon,Priya Anand,Jayendra,,,Epic Roasthouse (399 Embarcadero),SPI Cinemas,2011,180,\"Umarji Anuradha, Jayendra, Aarthi Sriram, & Suba \"\r\n\r\n# Should probably be:\r\n\r\n\"Actor1\",\"Actor2\",\"Actor3\",\"Director\",\"Distributor\",\"FunFacts\",\"Locations\",\"ProductionCompany\",\"ReleaseYear\",\"Title\",\"Writer\"\r\n\"Siddarth,Nithya\",\"Menon,Priya\",\"Anand,Jayendra\",,,\"Epic Roasthouse (399 Embarcadero)\",\"SPI Cinemas\",2011,180,\"Umarji Anuradha, Jayendra, Aarthi Sriram, & Suba \"\r\n```\r\n\r\nA trivial test importing and re-exporting a simple CSV shows that the export utility does the right thing *some* of the time. But unfortunately there appears to be a condition in the sample dataset that breaks it and causes the CLI tour to barf."},"comment":{"url":"https://api.github.com/repos/attic-labs/noms/issues/comments/243974214","html_url":"https://github.com/attic-labs/noms/issues/2490#issuecomment-243974214","issue_url":"https://api.github.com/repos/attic-labs/noms/issues/2490","id":243974214,"user":{"login":"aboodman","id":80388,"avatar_url":"https://avatars.githubusercontent.com/u/80388?v=3","gravatar_id":"","url":"https://api.github.com/users/aboodman","html_url":"https://github.com/aboodman","followers_url":"https://api.github.com/users/aboodman/followers","following_url":"https://api.github.com/users/aboodman/following{/other_user}","gists_url":"https://api.github.com/users/aboodman/gists{/gist_id}","starred_url":"https://api.github.com/users/aboodman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aboodman/subscriptions","organizations_url":"https://api.github.com/users/aboodman/orgs","repos_url":"https://api.github.com/users/aboodman/repos","events_url":"https://api.github.com/users/aboodman/events{/privacy}","received_events_url":"https://api.github.com/users/aboodman/received_events","type":"User","site_admin":false},"created_at":"2016-09-01T04:39:52Z","updated_at":"2016-09-01T04:39:52Z","body":"@vsivsi - this has been fixed now. The ordering of the columns changed and this doc was not updated to match. I just changed the import command from:\r\n\r\n```\r\ncsv-import --column-types=String,String,String,String,String,String,String,Number,String,String,String  /tmp/film-locations.csv /tmp/noms::films\r\n```\r\n\r\nto:\r\n\r\n```\r\ncsv-import --column-types=String,String,String,String,String,String,String,String,Number,String,String  /tmp/film-locations.csv /tmp/noms::films\r\n```\r\n\r\n(note position of number column)\r\n\r\nApologies!\r\n\r\nIt sounded like you hit some other issues exporting and importing your own CSVs. Can you please give an example?"}}
{"actor":{"display_login":"aboodman"}}