-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add utf8 column name support for query result data source #2145
Add utf8 column name support for query result data source #2145
Conversation
1549476
to
c788cd5
Compare
I'm not thrilled about renaming the columns... did you see which line throws this exception? |
Well, I do understand the feeling. As for the source of exception. def fix_column_name(name):
return name.replace(':', '_').replace('.', '_').replace(' ', '_') And then there's I guess other solutions might be:
I personally prefer the 2nd one, cause that seems to be a way to replace Any ideas? |
I prefer this one:
And we actually already support that -> in most cases, the user can add aliases to the columns in their original query. What we should have is a clear error message that says: "Only ASCII characters are supported for column names. Please rename column ... to a supported name.".
While the second option has its merits, I prefer to avoid it as it adds another step. What we should do to address the query_xxx issue is to either allow the user to use the query name as the table name or just implement auto complete that will translate query names to query_xxx. WDYT? |
That sounds right. Thanks for the idea. So the current plan would be:
As for the table name issue, I'll leave it out of the scope of this PR. |
On second thought, it's just better to create a new PR. |
Sorry for the confusion, but I didn't mean the new alias feature of the table visualization... I meant that the user can change it in the query itself, i.e.: SELECT column AS this_is_the_alias
FROM ... |
Ok, now I get what you mean. But unfortunately, our problem is exactly with data source that does not support this, such as Google Spread Sheet(GSS). I do see a localization card in re:dash's Trello. So I guess for this one, maybe these would be the options:
My preference would be 3 > 2 > 1. |
How about adding another sheet to your spreadsheet that references data from the main one, but with different column names? Also #4 might be an option, where we introduce a way to map column names in the query. 🤔 |
OK, I get the direction now.
↑next PR ↓research
|
👍 Re. GSS querying: I was thinking of adding the capabilities of the query results data source into the GSS one, so you could do:
But this doesn't help with aliases... Maybe when referencing the table you could setup the aliases? |
👍 |
Problem
When the column name contains non ASCII character, using query result as data source.
The original query result
Error when executing query from the query result
Use case
For original data source such as Google spread sheet, it is quite propable that sheet column was in non-ASCII language.
Implementation
Change non-ASCII column name into
"column_{}".format(column_number)
Though this doesn't seem to be a fundamental solution, a better one might bring more influence to other data source.