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