|
126 | 126 | ) |
127 | 127 |
|
128 | 128 | select distinct |
129 | | - failed_tests.alert_id, |
| 129 | + failed_tests.alert_id as alert_id, |
130 | 130 | {# Generate elementary unique id which is used to identify between tests, and set it as alert_class_id #} |
131 | 131 | {{ dbt.concat(["coalesce(failed_tests.test_unique_id, 'None')", "'.'", "coalesce(failed_tests.column_name, 'None')", "'.'", "coalesce(failed_tests.sub_type, 'None')"]) }} as alert_class_id, |
132 | 132 | case |
|
135 | 135 | when tests.short_name = 'dimension_anomalies' then failed_tests.test_unique_id |
136 | 136 | else {{ dbt.concat(["coalesce(failed_tests.test_unique_id, 'None')", "'.'", "coalesce(failed_tests.column_name, 'None')", "'.'", "coalesce(failed_tests.sub_type, 'None')"]) }} |
137 | 137 | end as elementary_unique_id, |
138 | | - failed_tests.data_issue_id, |
139 | | - failed_tests.test_execution_id, |
140 | | - failed_tests.test_unique_id, |
141 | | - failed_tests.model_unique_id, |
| 138 | + failed_tests.data_issue_id as data_issue_id, |
| 139 | + failed_tests.test_execution_id as test_execution_id, |
| 140 | + failed_tests.test_unique_id as test_unique_id, |
| 141 | + failed_tests.model_unique_id as model_unique_id, |
142 | 142 | {# Explicit aliases for columns that exist in both failed_tests and tests tables to avoid ClickHouse column name ambiguity #} |
143 | 143 | failed_tests.database_name as database_name, |
144 | | - failed_tests.detected_at, |
| 144 | + failed_tests.detected_at as detected_at, |
145 | 145 | {{ elementary.edr_current_timestamp() }} as created_at, |
146 | 146 | failed_tests.schema_name as schema_name, |
147 | | - failed_tests.table_name, |
148 | | - failed_tests.column_name, |
| 147 | + failed_tests.table_name as table_name, |
| 148 | + failed_tests.column_name as column_name, |
149 | 149 | failed_tests.test_type as alert_type, |
150 | | - failed_tests.sub_type, |
| 150 | + failed_tests.sub_type as sub_type, |
151 | 151 | failed_tests.test_results_description as alert_description, |
152 | | - failed_tests.owners, |
| 152 | + failed_tests.owners as owners, |
153 | 153 | failed_tests.tags as tags, |
154 | 154 | failed_tests.test_results_query as alert_results_query, |
155 | | - failed_tests.other, |
156 | | - failed_tests.test_name, |
157 | | - failed_tests.test_short_name, |
| 155 | + failed_tests.other as other, |
| 156 | + failed_tests.test_name as test_name, |
| 157 | + failed_tests.test_short_name as test_short_name, |
158 | 158 | failed_tests.test_params as test_params, |
159 | 159 | failed_tests.severity as severity, |
160 | 160 | failed_tests.status as status, |
161 | 161 | failed_tests.result_rows as result_rows, |
162 | 162 | tests.meta as test_meta, |
163 | 163 | tests.description as test_description, |
164 | 164 | artifacts_meta.meta as model_meta, |
165 | | - invocations.job_id, |
166 | | - invocations.job_name, |
167 | | - invocations.job_run_id, |
168 | | - invocations.job_url, |
169 | | - invocations.job_run_url, |
170 | | - invocations.orchestrator |
| 165 | + invocations.job_id as job_id, |
| 166 | + invocations.job_name as job_name, |
| 167 | + invocations.job_run_id as job_run_id, |
| 168 | + invocations.job_url as job_url, |
| 169 | + invocations.job_run_url as job_run_url, |
| 170 | + invocations.orchestrator as orchestrator |
171 | 171 | from failed_tests |
172 | 172 | left join tests on failed_tests.test_unique_id = tests.unique_id |
173 | 173 | left join artifacts_meta on failed_tests.model_unique_id = artifacts_meta.unique_id |
|
0 commit comments