Skip to content

Commit

Permalink
Fix another test
Browse files Browse the repository at this point in the history
  • Loading branch information
betodealmeida committed Nov 2, 2021
1 parent d9bd35b commit 39ffc51
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion superset/examples/birth_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def load_birth_names(
schema = inspect(engine).default_schema_name

tbl_name = "birth_names"
table_exists = database.has_table_by_name(tbl_name)
table_exists = database.has_table_by_name(tbl_name, schema=schema)

if not only_metadata and (not table_exists or force):
load_data(tbl_name, database, sample=sample)
Expand Down
7 changes: 6 additions & 1 deletion tests/integration_tests/datasource_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import prison
import pytest
from sqlalchemy import inspect

from superset import app, ConnectorRegistry, db
from superset.connectors.sqla.models import SqlaTable
Expand Down Expand Up @@ -278,8 +279,12 @@ def save_datasource_from_dict(self, datasource_post):

@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices")
def test_change_database(self):
database = get_example_database()
engine = database.get_sqla_engine()
schema = inspect(engine).default_schema_name

self.login(username="admin")
tbl = self.get_table(name="birth_names")
tbl = self.get_table(name="birth_names", schema=schema)
tbl_id = tbl.id
db_id = tbl.database_id
datasource_post = get_datasource_post()
Expand Down

0 comments on commit 39ffc51

Please sign in to comment.