You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/01/22 23:39:26 UTC

[GitHub] [superset] craig-rueda commented on a change in pull request #12702: fix(load_examples): better fix for load_data

craig-rueda commented on a change in pull request #12702:
URL: https://github.com/apache/superset/pull/12702#discussion_r562972976



##########
File path: superset/datasets/commands/importers/v1/utils.py
##########
@@ -137,7 +139,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_example_database().sqlalchemy_uri:
+    if example_database.sqlalchemy_uri == conf.get("SQLALCHEMY_DATABASE_URI"):

Review comment:
       I think you should check if they're the same OR the examples URI is null, as the loader logic uses the main URI as a fallback

##########
File path: superset/datasets/commands/importers/v1/utils.py
##########
@@ -125,6 +125,8 @@ def import_dataset(
 def load_data(
     data_uri: str, dataset: SqlaTable, example_database: Database, session: Session
 ) -> None:
+    from superset import conf

Review comment:
       Use current_app.config here




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org