You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "villebro (via GitHub)" <gi...@apache.org> on 2023/05/29 10:05:25 UTC

[GitHub] [superset] villebro commented on a diff in pull request #24241: fix(trino,mysql): handle string typed decimal results

villebro commented on code in PR #24241:
URL: https://github.com/apache/superset/pull/24241#discussion_r1209156539


##########
tests/unit_tests/db_engine_specs/test_trino.py:
##########
@@ -366,3 +369,37 @@ def test_handle_cursor_early_cancel(
         assert cancel_query_mock.call_args[1]["cancel_query_id"] == query_id
     else:
         assert cancel_query_mock.call_args is None
+
+
+@pytest.mark.parametrize(
+    "data,description,expected_result",
+    [
+        (
+            [["1.23456", "abc"]],
+            [("dec", "decimal(12,6)"), ("str", "varchar(3)")],
+            [(Decimal("1.23456"), "abc")],

Review Comment:
   Notice how we're changing from `list[list[Any]]` to `list[tuple[Any, ...]]` here - this is because this is what SQLA drivers *should* return. This will save us from having to do the conversion later here: https://github.com/apache/superset/blob/50535e427e51743e298d46009d51b08ef2380012/superset/result_set.py#L132-L134



-- 
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: notifications-unsubscribe@superset.apache.org

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