getodk / aggregate

ODK Aggregate is a Java server that stores, analyzes, and presents survey data collected using ODK Collect. Contribute and make the world a better place! ✨🗄✨
https://docs.opendatakit.org/aggregate-intro/
Other
74 stars 228 forks source link

Support underscores on column names in Google Spreadsheets #443

Open ggalmazor opened 5 years ago

ggalmazor commented 5 years ago

As per conversation on the forums, it looks like we're replacing allegedly unsafe characters, including: *, :, -, and _ in column names when publishing to Google Spreadsheets.

We should try to understand why this is being currently done and whether we need to continue doing it or not.

yanokwa commented 5 years ago

@ggalmazor Where in the code is this done? Maybe git blame would help figure this out. If not, I'm hoping this is an easy thing for you to test. Not a big priority though...

@wbrunette Do you know off the top of your head?

ggalmazor commented 5 years ago

I see a Dylan Price on the git blame. Does that ring a bell?

This came in 4c8abfcc0cbdde206c5cc72cb345d73d275304e0: "Fixed GoogleSpreadsheet trouble with special characters in headers and added parent-uid to repeat spreadsheets." Diff: https://github.com/opendatakit/aggregate/commit/4c8abfcc0cbdde206c5cc72cb345d73d275304e0?diff=unified&w=1

yanokwa commented 5 years ago

Yeah, I know Dylan, but I think it's too much work to track him down. We should just try underscores and special characters and update the code accordingly.

ggalmazor commented 5 years ago

OK, I'm tagging this issue for v2.1.0 so that we don't forget to give it a go before dismissing or fixing it.

wbrunette commented 5 years ago

Apologies for the delayed response. Old history from memory, not sure what is in the code now and haven't looked.

Column headings were originally the variable names in the xform (similar to how database columns operate). A feature request that got added was to change to the question vs the variable names in the spreadsheet.

Back to dashes and underscores ... 8-9 years ago Google spreadsheets did not support either dashes or underscores (can't remember which way it was) being in the column name and to make things complicated Google fusion tables did not accept the other, so we converted the dashes to underscores and underscores to dashes depending on which service we were exporting to based on the naming requirements of the Google service.

Statements in this comment are from memory recollection and have not been verified.