ckan/datapusher — pull request #47 by aliceh75 (2014-10-10 11:37:51+00:00)
Title: Strip column names

As per #46:

It is very easy to create column names that include spaces, in particular when hand-typing CSV data:

my field, my other field, a third field
value one, value two, value three

This will create fields named " my other field" and " a third field". Having field names that start/end with spaces causes a lot of complications, because some code strips the field names, while others don't. This is particularly true when using third party libraries, and parsing text-representations of strings such as the sort string "my field ASC, my other field DESC", etc.

See for instance: https://github.com/ckan/ckan/issues/1970

Given that there is no practical use for having field names that start or end with spaces (these will be just as confusing to humans as they are to machines), I suggest the datapusher should strip field names. (And, accordingly, CKAN datastore API should refuse field names that start/end with spaces).