mirror of
https://github.com/apache/superset.git
synced 2026-04-18 15:44:57 +00:00
Small fix for Presto dtype map (#8251)
* Small fix for Presto dtype map * Add unit test
This commit is contained in:
@@ -53,8 +53,8 @@ pandas_dtype_map = {
|
||||
"real": "float64",
|
||||
"double": "float64",
|
||||
"varchar": "object",
|
||||
"timestamp": "datetime64",
|
||||
"date": "datetime64",
|
||||
"timestamp": "datetime64[ns]",
|
||||
"date": "datetime64[ns]",
|
||||
"varbinary": "object",
|
||||
}
|
||||
|
||||
|
||||
@@ -129,3 +129,9 @@ class SupersetDataFrameTestCase(SupersetTestCase):
|
||||
cdf.raw_df.values.tolist(),
|
||||
[[np.nan], [1239162456494753670], [np.nan], [np.nan], [np.nan], [np.nan]],
|
||||
)
|
||||
|
||||
def test_pandas_datetime64(self):
|
||||
data = [(None,)]
|
||||
cursor_descr = [("ds", "timestamp", None, None, None, None, True)]
|
||||
cdf = SupersetDataFrame(data, cursor_descr, PrestoEngineSpec)
|
||||
self.assertEqual(cdf.raw_df.dtypes[0], np.dtype("<M8[ns]"))
|
||||
|
||||
Reference in New Issue
Block a user