diff --git a/superset/examples/birth_names.py b/superset/examples/birth_names.py index cedb2baf80103..25814a0ae95c2 100644 --- a/superset/examples/birth_names.py +++ b/superset/examples/birth_names.py @@ -38,6 +38,7 @@ def load_birth_names(only_metadata=False, force=False): """Loading birth name dataset from a zip file in the repo""" + # pylint: disable=too-many-locals tbl_name = "birth_names" database = get_example_database() table_exists = database.has_table_by_name(tbl_name) @@ -64,7 +65,7 @@ def load_birth_names(only_metadata=False, force=False): obj = db.session.query(TBL).filter_by(table_name=tbl_name).first() if not obj: print(f"Creating table [{tbl_name}] reference") - obj = TBL(tbl_name="birth_names") + obj = TBL(table_name=tbl_name) db.session.add(obj) obj.main_dttm_col = "ds" obj.database = database diff --git a/superset/examples/paris.py b/superset/examples/paris.py index 1de01cff7ffdc..a4f252b0343e4 100644 --- a/superset/examples/paris.py +++ b/superset/examples/paris.py @@ -21,7 +21,7 @@ from superset import db from superset.utils import core as utils -from .helpers import TBL, get_example_data +from .helpers import get_example_data, TBL def load_paris_iris_geojson(only_metadata=False, force=False): diff --git a/superset/examples/sf_population_polygons.py b/superset/examples/sf_population_polygons.py index d5fc42a975e12..738ac41f2cc35 100644 --- a/superset/examples/sf_population_polygons.py +++ b/superset/examples/sf_population_polygons.py @@ -21,7 +21,7 @@ from superset import db from superset.utils import core as utils -from .helpers import TBL, get_example_data +from .helpers import get_example_data, TBL def load_sf_population_polygons(only_metadata=False, force=False): diff --git a/superset/viz.py b/superset/viz.py index 5498becec671a..d81e16e0664d2 100644 --- a/superset/viz.py +++ b/superset/viz.py @@ -1746,7 +1746,7 @@ def query_obj(self): return qry def get_data(self, df): - from superset.data import countries + from superset.examples import countries fd = self.form_data cols = [fd.get("entity")] diff --git a/tests/load_examples_test.py b/tests/load_examples_test.py index 051f79521fc30..0d1db798b1f8e 100644 --- a/tests/load_examples_test.py +++ b/tests/load_examples_test.py @@ -14,26 +14,26 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -from superset import data +from superset import examples from superset.cli import load_test_users_run from .base_tests import SupersetTestCase class SupersetDataFrameTestCase(SupersetTestCase): def test_load_css_templates(self): - data.load_css_templates() + examples.load_css_templates() def test_load_energy(self): - data.load_energy() + examples.load_energy() def test_load_world_bank_health_n_pop(self): - data.load_world_bank_health_n_pop() + examples.load_world_bank_health_n_pop() def test_load_birth_names(self): - data.load_birth_names() + examples.load_birth_names() def test_load_test_users_run(self): load_test_users_run() def test_load_unicode_test_data(self): - data.load_unicode_test_data() + examples.load_unicode_test_data()