villebro commented on a change in pull request #8867: Make schema name for the 
CTA queries and limit configurable
URL: 
https://github.com/apache/incubator-superset/pull/8867#discussion_r382418605
 
 

 ##########
 File path: tests/celery_tests.py
 ##########
 @@ -199,15 +208,89 @@ def drop_table_if_exists(self, table_name, 
database=None):
             db.session.flush()
         return self.run_sql(db_id, sql)
 
-    def test_run_async_query(self):
+    @mock.patch(
+        "superset.views.core.get_cta_schema_name", lambda d, u, s, sql: 
CTAS_SCHEMA_NAME
+    )
+    def test_run_sync_query_cta_config(self):
+        main_db = get_example_database()
+        db_id = main_db.id
+        if main_db.backend == "sqlite":
+            # sqlite doesn't support schemas
+            return
+        tmp_table_name = "tmp_async_22"
+        expected_full_table_name = f"{CTAS_SCHEMA_NAME}.{tmp_table_name}"
 
 Review comment:
   Back to the topic of quoting.. `select_star` in `BaseEngineSpec` quotes 
`schema` and `table_name`, and I'm wondering if we shouldn't do that here 
(`views/core.py:Superset.sql_json_exec`), too. If not, then we just need to 
assume users won't be doing CTAS into schemas/tables with periods, which seems 
like a reasonable assumption, for now.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to