john-bodley edited a comment on issue #9316: fix: remove character set and 
collate column info by default
URL: 
https://github.com/apache/incubator-superset/pull/9316#issuecomment-599817900
 
 
   @villebro looking at the example data (using a MySQL database), 
   
   ```
   mysql> show create table energy_usage;
   
+--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | Table        | Create Table                                                
                                                                                
                                                                                
                        |
   
+--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | energy_usage | CREATE TABLE `energy_usage` (
     `source` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
     `target` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
     `value` float DEFAULT NULL
   ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci |
   
+--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   ```
   
   it seems that the column are defined with the `COLLATE` information which is 
reflected here, 
   
   ```python
   >>> from superset.utils.core import get_example_database
   >>> example_db = get_example_database()
   >>> sqla_table = example_db.get_table("energy_usage")
   >>> col = next(iter(sqla_table.columns))
   >>> col
   Column('source', VARCHAR(collation='utf8_unicode_ci', length=255), 
table=<energy_usage>)
   ```
   
   and thus I'm a little perplexed as to why we need 
`column_datatype_to_string` as surely this collation and character encoding 
code (and possibly should) be removed at the column level.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to