diff --git a/superset/datasets/commands/importers/v1/utils.py b/superset/datasets/commands/importers/v1/utils.py index 9021fb75e8a0c..d04763c7a8996 100644 --- a/superset/datasets/commands/importers/v1/utils.py +++ b/superset/datasets/commands/importers/v1/utils.py @@ -166,14 +166,22 @@ def load_data( if database.sqlalchemy_uri == current_app.config.get("SQLALCHEMY_DATABASE_URI"): logger.info("Loading data inside the import transaction") connection = session.connection() + df.to_sql( + dataset.table_name, + con=connection, + schema=dataset.schema, + if_exists="replace", + chunksize=CHUNKSIZE, + dtype=dtype, + index=False, + method="multi", + ) else: logger.warning("Loading data outside the import transaction") with database.get_sqla_engine_with_context() as engine: - connection = engine - df.to_sql( dataset.table_name, - con=connection, + con=engine, schema=dataset.schema, if_exists="replace", chunksize=CHUNKSIZE,