You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/04/14 06:22:08 UTC

[GitHub] [superset] villebro commented on a diff in pull request #19701: fix: convert column type to str during dual read/write

villebro commented on code in PR #19701:
URL: https://github.com/apache/superset/pull/19701#discussion_r850118534


##########
superset/connectors/sqla/utils.py:
##########
@@ -180,6 +180,15 @@ def is_column_type_temporal(column_type: TypeEngine) -> bool:
         return False
 
 
+def convert_column_type(column_type: TypeEngine) -> str:
+    if column_type.python_type == list:
+        return "ARRAY"
+    if column_type.python_type == dict:
+        return "JSON"

Review Comment:
   > Should we save the original database type here? The type field specifically used Text as storage so the originally intention is probably to allow storing the full schema of complex types such as ARRAY and STRUCT?
   
   I agree, using the original native type is the ideal solution here.



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

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org