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


##########
superset/db_engine_specs/base.py:
##########
@@ -737,7 +741,27 @@ def fetch_data(
         try:
             if cls.limit_method == LimitMethod.FETCH_MANY and limit:
                 return cursor.fetchmany(limit)
-            return cursor.fetchall()
+            data = cursor.fetchall()
+            description = cursor.description or []
+            column_type_mutators = {
+                row[0]: func
+                for row in description
+                if (
+                    func := cls.column_type_mutators.get(
+                        
type(cls.get_sqla_column_type(cls.get_datatype(row[1])))
+                    )
+                )
+            }
+            if column_type_mutators:

Review Comment:
   Good catch about the `coltypes`, let me investigate why that's gone missing.
   
   Wrt to the query performance hit, another option is to make the frontend 
more resilient to receiving various types. In this case we could cast the value 
to `number` in the frontend if the coltype is `GenericDataType.NUMERIC`. 
However, I'd prefer to do this type of transformation in the backend to ensure 
that the plugins don't have to deal with all the nuances that SQLAlchemy throws 
our way.
   
   I'd be curious to hear other peoples thoughts, @michael-s-molina 
@john-bodley any thoughts 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to