ckan / datapusher

A standalone web service that pushes data files from a CKAN site resources into its DataStore
GNU Affero General Public License v3.0
77 stars 155 forks source link

Strip column names #46

Closed aliceh75 closed 9 years ago

aliceh75 commented 10 years ago

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).

I will submit a PR for this.

aliceh75 commented 9 years ago

PR has been merged.