Adapter
dbt-fabric (Microsoft Fabric Warehouse); the same applies to dbt-sqlserver.
Summary
Even when per-test temp tables are registered for cleanup, the on-run-end DROP does not remove them on Fabric.
Root cause
get_clean_elementary_test_tables_queries (macros/edr/tests/test_utils/clean_elementary_test_tables.sql) has no fabric__/sqlserver__ variant, so Fabric falls back to default__ → get_transaction_clean_elementary_test_tables_queries:
BEGIN TRANSACTION;
DROP TABLE IF EXISTS [db].[schema].[table]; -- 3-part name
COMMIT;
On Fabric this does not drop the tables:
- DDL must run in the owning database's context; a cross-DB 3-part
DROP is not honoured when the elementary schema lives in a different database than the connection.
- wrapping DDL in
BEGIN TRANSACTION / COMMIT is unreliable on Fabric Warehouse.
This also prevents the registration fix in #1008 from having any effect.
Expected
A fabric__/sqlserver__get_clean_elementary_test_tables_queries that drops each relation in its own DB context without a transaction wrapper, e.g. EXEC [<db>]..sp_executesql N'drop table if exists [<schema>].[<id>]'.
Repro
Register a test temp table for cleanup and run on Fabric; the table remains after on-run-end.
Adapter
dbt-fabric (Microsoft Fabric Warehouse); the same applies to dbt-sqlserver.
Summary
Even when per-test temp tables are registered for cleanup, the on-run-end DROP does not remove them on Fabric.
Root cause
get_clean_elementary_test_tables_queries(macros/edr/tests/test_utils/clean_elementary_test_tables.sql) has nofabric__/sqlserver__variant, so Fabric falls back todefault__→get_transaction_clean_elementary_test_tables_queries:On Fabric this does not drop the tables:
DROPis not honoured when the elementary schema lives in a different database than the connection.BEGIN TRANSACTION/COMMITis unreliable on Fabric Warehouse.This also prevents the registration fix in #1008 from having any effect.
Expected
A
fabric__/sqlserver__get_clean_elementary_test_tables_queriesthat drops each relation in its own DB context without a transaction wrapper, e.g.EXEC [<db>]..sp_executesql N'drop table if exists [<schema>].[<id>]'.Repro
Register a test temp table for cleanup and run on Fabric; the table remains after on-run-end.