Skip to content

Commit b86f2e4

Browse files
author
ci bot
committed
Merge branch 'qa-fixes' into 'enterprise'
Fix QA issues See merge request dkinternal/testgen/dataops-testgen!211
2 parents da9f548 + e04ca59 commit b86f2e4

11 files changed

Lines changed: 20 additions & 16 deletions

File tree

testgen/common/models/scores.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,13 @@ def get_score_card_breakdown(
264264
"column_name": ["table_groups_id", "table_name", "column_name"],
265265
}.get(group_by, [group_by])
266266
filters = " AND ".join(self._get_raw_query_filters(cde_only=score_type == "cde_score"))
267-
join_condition = " AND ".join([f"test_records.{column} = profiling_records.{column}" for column in columns])
267+
268+
if group_by in ["table_groups_name", "table_name", "column_name"]:
269+
join_condition = " AND ".join([f"test_records.{column} = profiling_records.{column}" for column in columns])
270+
else:
271+
join_condition = f"""(test_records.{group_by} = profiling_records.{group_by}
272+
OR (test_records.{group_by} IS NULL
273+
AND profiling_records.{group_by} IS NULL))"""
268274

269275
profile_records_filters = self._get_raw_query_filters(
270276
cde_only=score_type == "cde_score",

testgen/template/dbsetup/075_grant_role_rights.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ GRANT SELECT, INSERT, DELETE, UPDATE ON
3737
{SCHEMA_NAME}.score_definition_results,
3838
{SCHEMA_NAME}.score_definition_results_breakdown,
3939
{SCHEMA_NAME}.score_definition_results_history,
40-
{SCHEMA_NAME}.score_history_latest_runs
40+
{SCHEMA_NAME}.score_history_latest_runs,
41+
{SCHEMA_NAME}.job_schedules
4142
TO testgen_execute_role;
4243

4344

testgen/template/score_cards/get_score_card_breakdown_by_column.sql

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ profiling_records AS (
77
SUM(record_ct) AS data_point_ct,
88
SUM(record_ct * good_data_pct) / NULLIF(SUM(record_ct), 0) AS score
99
FROM v_dq_profile_scoring_latest_by_column
10-
WHERE NULLIF({group_by}, '') IS NOT NULL
11-
AND {filters}
10+
WHERE {filters}
1211
GROUP BY project_code, {columns}
1312
),
1413
test_records AS (
@@ -19,8 +18,7 @@ test_records AS (
1918
SUM(dq_record_ct) AS data_point_ct,
2019
SUM(dq_record_ct * good_data_pct) / NULLIF(SUM(dq_record_ct), 0) AS score
2120
FROM v_dq_test_scoring_latest_by_column
22-
WHERE NULLIF({group_by}, '') IS NOT NULL
23-
AND {filters}
21+
WHERE {filters}
2422
GROUP BY project_code, {columns}
2523
),
2624
parent AS (

testgen/template/score_cards/get_score_card_breakdown_by_dimension.sql

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ profiling_records AS (
77
SUM(record_ct) AS data_point_ct,
88
SUM(record_ct * good_data_pct) / NULLIF(SUM(record_ct), 0) AS score
99
FROM v_dq_profile_scoring_latest_by_dimension
10-
WHERE NULLIF({group_by}, '') IS NOT NULL
11-
AND {filters}
10+
WHERE {filters}
1211
GROUP BY project_code, {columns}
1312
),
1413
test_records AS (
@@ -19,8 +18,7 @@ test_records AS (
1918
SUM(dq_record_ct) AS data_point_ct,
2019
SUM(dq_record_ct * good_data_pct) / NULLIF(SUM(dq_record_ct), 0) AS score
2120
FROM v_dq_test_scoring_latest_by_dimension
22-
WHERE NULLIF({group_by}, '') IS NOT NULL
23-
AND {filters}
21+
WHERE {filters}
2422
GROUP BY project_code, {columns}
2523
),
2624
parent AS (

testgen/ui/components/frontend/js/components/score_breakdown.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ const TableCell = (row, column, score=undefined, category=undefined, scoreType=u
111111
const size = BREAKDOWN_COLUMNS_SIZES[column] ?? COLUMN_DEFAULT_SIZE;
112112
return div(
113113
{ style: `flex: ${size}; max-width: ${size}; word-wrap: break-word;`, 'data-testid': 'score-breakdown-cell' },
114-
span(row[column]),
114+
span(row[column] ?? '-'),
115115
);
116116
};
117117

testgen/ui/components/frontend/js/components/score_issues.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ const TimeCell = (value, row) => {
311311
run_id: row.run_id,
312312
table_name: row.table,
313313
column_name: row.column,
314+
selected: row.id,
314315
},
315316
}),
316317
);

testgen/ui/views/dialogs/run_profiling_dialog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def run_profiling_dialog(project_code: str, table_group: pd.Series | None = None
6565
testgen.link(
6666
label="Go to Profiling Runs",
6767
href=LINK_HREF,
68-
params={ "table_group": table_group_id },
68+
params={ "project_code": project_code, "table_group": table_group_id },
6969
right_icon="chevron_right",
7070
underline=False,
7171
height=40,

testgen/ui/views/dialogs/run_tests_dialog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def run_tests_dialog(project_code: str, test_suite: pd.Series | None = None, def
6969
testgen.link(
7070
label="Go to Test Runs",
7171
href=LINK_HREF,
72-
params={ "test_suite": test_suite_id },
72+
params={ "project_code": project_code, "test_suite": test_suite_id },
7373
right_icon="chevron_right",
7474
underline=False,
7575
height=40,

testgen/ui/views/score_details.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def delete_score_card(definition_id: str) -> None:
187187
if delete_clicked():
188188
score_definition.delete()
189189
get_all_score_cards.clear()
190-
Router().navigate("quality-dashboard")
190+
Router().navigate("quality-dashboard", { "project_code": score_definition.project_code })
191191

192192

193193
def recalculate_score_history(definition_id: str) -> None:

testgen/ui/views/table_groups/page.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def render(self, connection_id: str, **_kwargs) -> None:
9898
testgen.link(
9999
label="Test Suites",
100100
href="test-suites",
101-
params={"table_group_id": table_group["id"]},
101+
params={ "project_code": project_code, "table_group_id": table_group["id"] },
102102
right_icon="chevron_right",
103103
key=f"tablegroups:keys:go-to-tsuites:{table_group['id']}",
104104
)

0 commit comments

Comments
 (0)