Copilot commented on code in PR #36747:
URL: https://github.com/apache/superset/pull/36747#discussion_r2669628054
##########
tests/unit_tests/sql/parse_tests.py:
##########
@@ -2891,6 +2891,20 @@ def test_singlestore_engine_mapping():
assert "COUNT(*)" in formatted
+def test_awsathena_engine_mapping():
+ """
+ Test the `awsathena` dialect is properly mapped to ATHENA instead of
PRESTO.
+ """
+ sql = (
+ "USING EXTERNAL FUNCTION my_func(x INT) RETURNS INT LAMBDA
'lambda_name' "
+ "SELECT my_func(id) FROM my_table"
+ )
+ statement = SQLStatement(sql, engine="awsathena")
+
+ # Should parse without errors using Athena dialect
+ statement.format()
Review Comment:
The test should assert that the parsing succeeds rather than just calling
format() without capturing or verifying the result. Consider adding an
assertion to verify the formatted output is not None or that no exception is
raised. Following the pattern from test_singlestore_engine_mapping, you could
also verify that the query is correctly identified as a SELECT statement.
--
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]