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

 ##########
 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:
   I am open to either, quote while generating SQL or quote early on when 
getting the user input.
   I think both approaches are good, the latter one would be a bit involved as 
table object creation should be quoted for SQLATable, Column and Metric. This 
test case just demonstrates the existing behavior, modifying it probably would 
be out of scope of this change, but definitely a useful improvement.

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