Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions superset/datasets/commands/importers/v1/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

from superset.connectors.sqla.models import SqlaTable
from superset.models.core import Database
from superset.utils.core import get_example_database, get_main_database
from superset.utils.core import get_example_database

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -136,7 +136,7 @@ def load_data(
df[column_name] = pd.to_datetime(df[column_name])

# reuse session when loading data if possible, to make import atomic
if example_database.sqlalchemy_uri == get_main_database().sqlalchemy_uri:
if example_database.sqlalchemy_uri == get_example_database().sqlalchemy_uri:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dpgaspar this condition will always be true, and causes the example data to be loaded into the main database instead of the examples databases (because it always reuses session.connection().

logger.info("Loading data inside the import transaction")
connection = session.connection()
else:
Expand Down