mistercrunch commented on a change in pull request #4724: Improve database type
inference
URL:
https://github.com/apache/incubator-superset/pull/4724#discussion_r178483226
##########
File path: superset/db_engine_specs.py
##########
@@ -495,6 +502,24 @@ def adjust_database_uri(cls, uri, selected_schema=None):
uri.database = selected_schema
return uri
+ @classmethod
+ def get_datatype(cls, type_code):
+ if not cls.type_code_map:
+ # only import and store if needed at least once
+ import MySQLdb
+ ft = MySQLdb.constants.FIELD_TYPE
+ cls.type_code_map = {
+ getattr(ft, k): k
+ for k in dir(ft)
+ if not k.startswith('_')
+ }
+ print(cls.type_code_map)
Review comment:
oops
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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