Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Jul 17, 2019
1 parent 146f599 commit 4ca819d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
3 changes: 2 additions & 1 deletion superset/examples/birth_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion superset/examples/paris.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion superset/examples/sf_population_polygons.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion superset/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
12 changes: 6 additions & 6 deletions tests/load_examples_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit 4ca819d

Please sign in to comment.