mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
[fix] Enforce the query result to contain a data-frame (#8935)
This commit is contained in:
@@ -251,7 +251,7 @@ class SqlaTableModelTestCase(SupersetTestCase):
|
||||
else:
|
||||
self.assertNotIn("JOIN", sql.upper())
|
||||
spec.allows_joins = old_inner_join
|
||||
self.assertIsNotNone(qr.df)
|
||||
self.assertFalse(qr.df.empty)
|
||||
return qr.df
|
||||
|
||||
def test_query_with_expr_groupby_timeseries(self):
|
||||
@@ -262,8 +262,9 @@ class SqlaTableModelTestCase(SupersetTestCase):
|
||||
|
||||
df1 = self.query_with_expr_helper(is_timeseries=True, inner_join=True)
|
||||
df2 = self.query_with_expr_helper(is_timeseries=True, inner_join=False)
|
||||
self.assertIsNotNone(df2) # df1 can be none if the db does not support join
|
||||
if df1 is not None:
|
||||
self.assertFalse(df2.empty)
|
||||
# df1 can be empty if the db does not support join
|
||||
if not df1.empty:
|
||||
pandas.testing.assert_frame_equal(
|
||||
cannonicalize_df(df1), cannonicalize_df(df2)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user