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:46:23 UTC

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

betodealmeida commented on a change in pull request #12702:
URL: https://github.com/apache/superset/pull/12702#discussion_r562974758



##########
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:
       `example_database.sqlalchemy_uri` will be set to `SQLALCHEMY_DATABASE_URI` if `SQLALCHEMY_EXAMPLES_URI` is not set, so this should catch it, no?

##########
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:
       Cool!




----------------------------------------------------------------
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