diegomedina248 commented on code in PR #20119:
URL: https://github.com/apache/superset/pull/20119#discussion_r876247896


##########
superset/utils/csv.py:
##########
@@ -97,11 +99,18 @@ def get_chart_dataframe(
         return None
 
     result = simplejson.loads(content.decode("utf-8"))
-
     # need to convert float value to string to show full long number
     pd.set_option("display.float_format", lambda x: str(x))
     df = pd.DataFrame.from_dict(result["result"][0]["data"])
 
+    # if any column type is equal to 2, need to convert data into datetime 
timestamp for that column.
+    if GenericDataType.TEMPORAL in result["result"][0]["coltypes"]:
+        for i in range(len(result["result"][0]["coltypes"])):
+            if result["result"][0]["coltypes"][i] == GenericDataType.TEMPORAL:
+                df[result["result"][0]["colnames"][i]] = df[
+                    result["result"][0]["colnames"][i]
+                ].astype("datetime64[ms]")

Review Comment:
   will this work for all databases?



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