bmuraykhi commented on code in PR #45961:
URL: https://github.com/apache/superset/pull/45961#discussion_r4465453621
##########
tests/testcontainers/db_engine_specs/test_clickhouse.py:
##########
@@ -137,6 +137,47 @@ def test_get_columns_maps_native_types(engine: Engine) ->
None:
assert isinstance(spec.sqla_type, Integer)
+def test_physical_table_metadata_serializes_expression_columns(
+ engine: Engine,
+) -> None:
+ from tests.integration_tests.test_app import app
+
+ with app.app_context():
+ from superset.connectors.sqla.utils import get_physical_table_metadata
+ from superset.db_engine_specs.clickhouse import
ClickHouseConnectEngineSpec
+ from superset.utils import json
+
+ with engine.begin() as conn:
+ conn.execute(
+ text(
+ "CREATE TABLE pilot_expressions ("
+ "ts DateTime, price Float64, qty UInt32, "
+ "total Float64 ALIAS price * qty, "
+ "day Date MATERIALIZED toDate(ts), "
+ "note String DEFAULT 'x'"
+ ") ENGINE = MergeTree ORDER BY ts"
+ )
+ )
Review Comment:
the `engine` fixture is module-scoped and starts a fresh container every
run, and each test here uses its own table name, so nothing can be left over to
collide with. same as `pilot_group_by_all` below.
--
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]