mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
chore: Improve chart data API + schemas + tests (#9599)
* Make all fields optional in QueryObject and fix having_druid schema * fix: datasource type sql to table * lint * Add missing fields * Refactor tests * Linting * Refactor query context fixtures * Add typing to test func
This commit is contained in:
@@ -558,7 +558,7 @@ class ImportExportTests(SupersetTestCase):
|
||||
def test_import_table_no_metadata(self):
|
||||
table = self.create_table("pure_table", id=10001)
|
||||
imported_id = SqlaTable.import_obj(table, import_time=1989)
|
||||
imported = self.get_table(imported_id)
|
||||
imported = self.get_table_by_id(imported_id)
|
||||
self.assert_table_equals(table, imported)
|
||||
|
||||
def test_import_table_1_col_1_met(self):
|
||||
@@ -566,7 +566,7 @@ class ImportExportTests(SupersetTestCase):
|
||||
"table_1_col_1_met", id=10002, cols_names=["col1"], metric_names=["metric1"]
|
||||
)
|
||||
imported_id = SqlaTable.import_obj(table, import_time=1990)
|
||||
imported = self.get_table(imported_id)
|
||||
imported = self.get_table_by_id(imported_id)
|
||||
self.assert_table_equals(table, imported)
|
||||
self.assertEqual(
|
||||
{"remote_id": 10002, "import_time": 1990, "database_name": "examples"},
|
||||
@@ -582,7 +582,7 @@ class ImportExportTests(SupersetTestCase):
|
||||
)
|
||||
imported_id = SqlaTable.import_obj(table, import_time=1991)
|
||||
|
||||
imported = self.get_table(imported_id)
|
||||
imported = self.get_table_by_id(imported_id)
|
||||
self.assert_table_equals(table, imported)
|
||||
|
||||
def test_import_table_override(self):
|
||||
@@ -599,7 +599,7 @@ class ImportExportTests(SupersetTestCase):
|
||||
)
|
||||
imported_over_id = SqlaTable.import_obj(table_over, import_time=1992)
|
||||
|
||||
imported_over = self.get_table(imported_over_id)
|
||||
imported_over = self.get_table_by_id(imported_over_id)
|
||||
self.assertEqual(imported_id, imported_over.id)
|
||||
expected_table = self.create_table(
|
||||
"table_override",
|
||||
@@ -627,7 +627,7 @@ class ImportExportTests(SupersetTestCase):
|
||||
imported_id_copy = SqlaTable.import_obj(copy_table, import_time=1994)
|
||||
|
||||
self.assertEqual(imported_id, imported_id_copy)
|
||||
self.assert_table_equals(copy_table, self.get_table(imported_id))
|
||||
self.assert_table_equals(copy_table, self.get_table_by_id(imported_id))
|
||||
|
||||
def test_import_druid_no_metadata(self):
|
||||
datasource = self.create_druid_datasource("pure_druid", id=10001)
|
||||
|
||||
Reference in New Issue
Block a user