|
1 | 1 | import pytest |
2 | 2 | from dbt.tests.util import run_dbt, write_file |
3 | 3 |
|
4 | | -from tests.functional.adapter.fixtures import MaterializationV1Mixin, MaterializationV2Mixin |
| 4 | +from tests.functional.adapter.fixtures import ( |
| 5 | + MaterializationV1Mixin, |
| 6 | + MaterializationV2Mixin, |
| 7 | + RequiresDescribeAsJsonCapabilityMixin, |
| 8 | +) |
5 | 9 | from tests.functional.adapter.row_filters.fixtures import ( |
6 | 10 | base_model_mv, |
7 | 11 | base_model_sql, |
@@ -142,6 +146,20 @@ def test_incremental_row_filter_lifecycle(self, project): |
142 | 146 | assert len(filters) == 0 |
143 | 147 |
|
144 | 148 |
|
| 149 | +@pytest.mark.skip_profile("databricks_cluster") |
| 150 | +class TestIncrementalRowFilterDescribeJsonOn( |
| 151 | + RequiresDescribeAsJsonCapabilityMixin, TestIncrementalRowFilter |
| 152 | +): |
| 153 | + @pytest.fixture(scope="class") |
| 154 | + def project_config_update(self): |
| 155 | + return { |
| 156 | + "flags": { |
| 157 | + "use_materialization_v2": True, |
| 158 | + "use_describe_as_json_for_relation_metadata": True, |
| 159 | + } |
| 160 | + } |
| 161 | + |
| 162 | + |
145 | 163 | @pytest.mark.skip_profile("databricks_cluster", "databricks_uc_cluster") |
146 | 164 | class TestMaterializedViewRowFilter(RowFilterMixin): |
147 | 165 | """Test row filters on materialized view models.""" |
@@ -177,6 +195,20 @@ def test_mv_row_filter_lifecycle(self, project): |
177 | 195 | assert len(filters) == 0 |
178 | 196 |
|
179 | 197 |
|
| 198 | +@pytest.mark.skip_profile("databricks_cluster", "databricks_uc_cluster") |
| 199 | +class TestMaterializedViewRowFilterDescribeJsonOn( |
| 200 | + RequiresDescribeAsJsonCapabilityMixin, TestMaterializedViewRowFilter |
| 201 | +): |
| 202 | + @pytest.fixture(scope="class") |
| 203 | + def project_config_update(self): |
| 204 | + return { |
| 205 | + "flags": { |
| 206 | + "use_materialization_v2": True, |
| 207 | + "use_describe_as_json_for_relation_metadata": True, |
| 208 | + } |
| 209 | + } |
| 210 | + |
| 211 | + |
180 | 212 | @pytest.mark.skip_profile("databricks_cluster", "databricks_uc_cluster") |
181 | 213 | class TestStreamingTableRowFilter(RowFilterMixin): |
182 | 214 | """Test row filters on streaming table models.""" |
@@ -228,6 +260,20 @@ def test_streaming_table_row_filter_lifecycle(self, project): |
228 | 260 | assert len(filters) == 0 |
229 | 261 |
|
230 | 262 |
|
| 263 | +@pytest.mark.skip_profile("databricks_cluster", "databricks_uc_cluster") |
| 264 | +class TestStreamingTableRowFilterDescribeJsonOn( |
| 265 | + RequiresDescribeAsJsonCapabilityMixin, TestStreamingTableRowFilter |
| 266 | +): |
| 267 | + @pytest.fixture(scope="class") |
| 268 | + def project_config_update(self): |
| 269 | + return { |
| 270 | + "flags": { |
| 271 | + "use_materialization_v2": True, |
| 272 | + "use_describe_as_json_for_relation_metadata": True, |
| 273 | + } |
| 274 | + } |
| 275 | + |
| 276 | + |
231 | 277 | @pytest.mark.skip_profile("databricks_cluster") |
232 | 278 | class TestViewRowFilterFailure(MaterializationV2Mixin): |
233 | 279 | """Test that row filters on regular views fail with clear error.""" |
|
0 commit comments