From af8dc8d590b318cf0e3dc7f4c600151eb31e56ab Mon Sep 17 00:00:00 2001 From: Carlos Fidel Selva Ochoa Date: Tue, 16 Mar 2021 22:42:36 -0600 Subject: [PATCH 1/2] Cast out of bounds timestamps as objects As a fix to https://github.com/apache/superset/issues/13661, timestamps can be passed as objects https://issues.apache.org/jira/browse/ARROW-7856 --- superset/result_set.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/superset/result_set.py b/superset/result_set.py index 34d5dc909d630..83c92e7c38b2f 100644 --- a/superset/result_set.py +++ b/superset/result_set.py @@ -174,7 +174,8 @@ def convert_pa_dtype(pa_dtype: pa.DataType) -> Optional[str]: @staticmethod def convert_table_to_df(table: pa.Table) -> pd.DataFrame: - return table.to_pandas(integer_object_nulls=True) + return table.to_pandas(integer_object_nulls=True, + timestamp_as_object=True) @staticmethod def first_nonempty(items: List[Any]) -> Any: From adfacb2e0b77915617848b79316053aac0f8e8ad Mon Sep 17 00:00:00 2001 From: Carlos Fidel Selva Ochoa Date: Sat, 10 Apr 2021 15:40:51 -0500 Subject: [PATCH 2/2] Changes to comply with tox --pre-commit --- superset/result_set.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/superset/result_set.py b/superset/result_set.py index 83c92e7c38b2f..4ed8beb3d203d 100644 --- a/superset/result_set.py +++ b/superset/result_set.py @@ -174,8 +174,7 @@ def convert_pa_dtype(pa_dtype: pa.DataType) -> Optional[str]: @staticmethod def convert_table_to_df(table: pa.Table) -> pd.DataFrame: - return table.to_pandas(integer_object_nulls=True, - timestamp_as_object=True) + return table.to_pandas(integer_object_nulls=True, timestamp_as_object=True) @staticmethod def first_nonempty(items: List[Any]) -> Any: