pizofreude commented on code in PR #36422:
URL: https://github.com/apache/superset/pull/36422#discussion_r2617210385


##########
tests/integration_tests/databases/api_tests.py:
##########
@@ -4126,6 +4126,74 @@ def test_validate_sql_endpoint_failure(self, 
get_validator_by_name):
         assert rv.status_code == 422
         assert "Kaboom!" in response["errors"][0]["message"]
 
+    @mock.patch.dict(
+        "superset.config.SQL_VALIDATORS_BY_ENGINE",
+        SQL_VALIDATORS_BY_ENGINE,
+        clear=True,
+    )
+    def test_validate_sql_with_jinja_templates(self):

Review Comment:
   Good integration test coverage. A couple of suggestions:
   
   1. Instead of asserting that '{' and '%' are not in any error message (which 
is a useful smoke check), can we also assert that response["result"] indicates 
successful validation (e.g., empty list or a specific valid-structure 
response)? That makes the test less coupled to exact message content.
   1. Could you add a test case that passes an invalid templated SQL which 
should fail validation after rendering (to ensure we don't accidentally hide 
real SQL errors)?



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to