mirror of
https://github.com/apache/superset.git
synced 2026-04-22 01:24:43 +00:00
Improve examples & related tests (#7773)
* [WiP] improve load_examples related to #7472, longer term we will generate the examples by exporting them into tarball as in #7472. In the meantime, we need this subset of the features: * allowing specifying an alternate database connection for examples * allowing a --only-metadata flag to `load_examples` to load only dashboard and chart definitions, no actual data is loaded * Improve logging * Rename data->examples * Load only if not exist * By default do not load, add a force flag * fix build * set published to true
This commit is contained in:
committed by
GitHub
parent
86fdceb236
commit
d65b039219
@@ -39,6 +39,7 @@ from superset.db_engine_specs.pinot import PinotEngineSpec
|
||||
from superset.db_engine_specs.postgres import PostgresEngineSpec
|
||||
from superset.db_engine_specs.presto import PrestoEngineSpec
|
||||
from superset.models.core import Database
|
||||
from superset.utils.core import get_example_database
|
||||
from .base_tests import SupersetTestCase
|
||||
|
||||
|
||||
@@ -925,14 +926,14 @@ class DbEngineSpecsTestCase(SupersetTestCase):
|
||||
) # noqa
|
||||
|
||||
def test_column_datatype_to_string(self):
|
||||
main_db = self.get_main_database()
|
||||
sqla_table = main_db.get_table("energy_usage")
|
||||
dialect = main_db.get_dialect()
|
||||
example_db = get_example_database()
|
||||
sqla_table = example_db.get_table("energy_usage")
|
||||
dialect = example_db.get_dialect()
|
||||
col_names = [
|
||||
main_db.db_engine_spec.column_datatype_to_string(c.type, dialect)
|
||||
example_db.db_engine_spec.column_datatype_to_string(c.type, dialect)
|
||||
for c in sqla_table.columns
|
||||
]
|
||||
if main_db.backend == "postgresql":
|
||||
if example_db.backend == "postgresql":
|
||||
expected = ["VARCHAR(255)", "VARCHAR(255)", "DOUBLE PRECISION"]
|
||||
else:
|
||||
expected = ["VARCHAR(255)", "VARCHAR(255)", "FLOAT"]
|
||||
|
||||
Reference in New Issue
Block a user