From 3971779ea67c6c45167c5c7e75a5ad4dfcdeaac1 Mon Sep 17 00:00:00 2001 From: Michelle Thomas Date: Fri, 16 Mar 2018 11:09:02 -0700 Subject: [PATCH] Adding tests for failing sqllab data type (cherry picked from commit 12caf6565df2b4259b993833d4d0132a1dfe5933) --- tests/sqllab_tests.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/sqllab_tests.py b/tests/sqllab_tests.py index ecaa23ca52f72..977bbe0d35554 100644 --- a/tests/sqllab_tests.py +++ b/tests/sqllab_tests.py @@ -210,6 +210,14 @@ def test_df_conversion_no_dict(self): self.assertEquals(len(data), cdf.size) self.assertEquals(len(cols), len(cdf.columns)) + def test_df_conversion_tuple(self): + cols = [['string_col'], ['int_col'], ['list_col'], ['float_col']] + data = [(u'Text', 111, [123], 1.0)] + cdf = convert_results_to_df(cols, data) + + self.assertEquals(len(data), cdf.size) + self.assertEquals(len(cols), len(cdf.columns)) + def test_df_conversion_dict(self): cols = [['string_col'], ['dict_col'], ['int_col']] data = [['a', {'c1': 1, 'c2': 2, 'c3': 3}, 4]]