Skip to content

Commit 2dae9de

Browse files
author
ci bot
committed
Merge branch 'aarthy/version-fix' into 'enterprise'
Fix empty version + score display tweaks See merge request dkinternal/testgen/dataops-testgen!168
2 parents f0e404f + 82efe24 commit 2dae9de

5 files changed

Lines changed: 26 additions & 11 deletions

File tree

deploy/docker-bake.hcl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
variable "TESTGEN_LABELS" {}
22
variable "TESTGEN_BASE_LABEL" {}
33
variable "TESTGEN_VERSION" {}
4+
variable "TESTGEN_DOCKER_HUB_REPO" {
5+
"default": "datakitchen/dataops-testgen"
6+
}
47

58
target "testgen-release" {
69
args = {
710
TESTGEN_VERSION = "${TESTGEN_VERSION}"
811
TESTGEN_BASE_LABEL = "${TESTGEN_BASE_LABEL}"
12+
TESTGEN_DOCKER_HUB_REPO = "${TESTGEN_DOCKER_HUB_REPO}"
913
}
1014
context = "."
1115
dockerfile = "deploy/testgen.dockerfile"
@@ -17,6 +21,7 @@ target "testgen-qa" {
1721
args = {
1822
TESTGEN_VERSION = "${TESTGEN_VERSION}"
1923
TESTGEN_BASE_LABEL = "${TESTGEN_BASE_LABEL}"
24+
TESTGEN_DOCKER_HUB_REPO = "${TESTGEN_DOCKER_HUB_REPO}"
2025
}
2126
context = "."
2227
dockerfile = "deploy/testgen.dockerfile"

deploy/testgen.dockerfile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
ARG TESTGEN_BASE_LABEL
2-
ARG TESTGEN_VERSION
1+
ARG TESTGEN_BASE_LABEL=v1
32

4-
FROM datakitchen/dataops-testgen-base:${TESTGEN_BASE_LABEL} as build-image
3+
FROM datakitchen/dataops-testgen-base:${TESTGEN_BASE_LABEL} AS build-image
54

65
# Now install everything
76
COPY . /tmp/dk/
87
RUN python3 -m pip install --prefix=/dk /tmp/dk
98

109
FROM python:3.12.7-alpine3.20 AS release-image
1110

11+
# Args have to be set in current build stage: https://github.com/moby/moby/issues/37345
12+
ARG TESTGEN_VERSION
13+
ARG TESTGEN_DOCKER_HUB_REPO
14+
1215
RUN addgroup -S testgen && adduser -S testgen -G testgen
1316

1417
COPY --from=build-image --chown=testgen:testgen /dk/ /dk
@@ -25,7 +28,7 @@ ENV PATH="$PATH:/dk/bin:/opt/mssql-tools/bin/"
2528

2629
ENV TESTGEN_VERSION=${TESTGEN_VERSION}
2730
ENV TG_RELEASE_CHECK=docker
28-
ENV TESTGEN_DOCKER_HUB_REPO=datakitchen/dataops-testgen-enterprise
31+
ENV TESTGEN_DOCKER_HUB_REPO=${TESTGEN_DOCKER_HUB_REPO}
2932
ENV STREAMLIT_SERVER_MAX_UPLOAD_SIZE=200
3033

3134
RUN mkdir /var/lib/testgen && chown testgen:testgen /var/lib/testgen

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,16 @@ const ScoreBreakdown = (score, breakdown, category, scoreType, onViewDetails) =>
2828
},
2929
span('for'),
3030
() => {
31+
const scoreValue = getValue(score);
3132
const selectedScoreType = getValue(scoreType);
33+
const scoreTypeOptions = ['score', 'cde_score'].filter((s) => scoreValue[s])
34+
if (!scoreTypeOptions.length) {
35+
scoreTypeOptions.push('score');
36+
}
3237
return Select({
3338
label: '',
3439
value: selectedScoreType,
35-
options: ['score', 'cde_score'].map((s) => ({ label: SCORE_TYPE_LABEL[s], value: s, selected: s === scoreType })),
40+
options: scoreTypeOptions.map((s) => ({ label: SCORE_TYPE_LABEL[s], value: s, selected: s === scoreType })),
3641
onChange: (value) => emitEvent('ScoreTypeChanged', { payload: value }),
3742
});
3843
},
@@ -41,7 +46,7 @@ const ScoreBreakdown = (score, breakdown, category, scoreType, onViewDetails) =>
4146
),
4247
() => div(
4348
{ class: 'table-header breakdown-columns flex-row' },
44-
getValue(breakdown)?.columns?.map(column => span({
49+
getValue(breakdown)?.columns?.map(column => span({
4550
style: `flex: ${BREAKDOWN_COLUMNS_SIZES[column]};` },
4651
getReadableColumn(column, getValue(scoreType)),
4752
)),
@@ -64,7 +69,7 @@ const ScoreBreakdown = (score, breakdown, category, scoreType, onViewDetails) =>
6469

6570
/**
6671
* Translate the column names for the table.
67-
*
72+
*
6873
* @param {Array<string>} columns
6974
* @param {('table_name' | 'column_name' | 'semantic_data_type' | 'dq_dimension')} category
7075
* @param {('score' | 'cde_score')} scoreType
@@ -82,7 +87,7 @@ function getReadableColumn(column, scoreType) {
8287
}
8388

8489
/**
85-
*
90+
*
8691
* @param {object} row
8792
* @param {string} column
8893
* @returns {<string>}
@@ -205,4 +210,4 @@ stylesheet.replace(`
205210
}
206211
`);
207212

208-
export { ScoreBreakdown };
213+
export { ScoreBreakdown };

testgen/ui/views/quality_dashboard.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def render(self, *, project_code: str, **_kwargs) -> None:
3131
"table_groups_count": int(project_summary["table_groups_ct"]),
3232
"profiling_runs_count": int(project_summary["profiling_runs_ct"]),
3333
},
34-
"scores": [format_score_card(score) for score in get_all_score_cards(project_code)],
34+
"scores": [format_score_card(score) for score in get_all_score_cards(project_code) if score["score"] or score["cde_score"] or score["categories"]],
3535
},
3636
on_change_handlers={
3737
"RefreshData": refresh_data,

testgen/ui/views/score_details.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def render(
2929
*,
3030
definition_id: str,
3131
category: str = "table_name",
32-
score_type: str = "score",
32+
score_type: str | None = None,
3333
drilldown: str | None = None,
3434
**_kwargs
3535
):
@@ -57,6 +57,8 @@ def render(
5757
with st.spinner(text="Loading data ..."):
5858
user_can_edit = authentication_service.current_user_has_edit_role()
5959
score_card = format_score_card(score_definition.as_score_card())
60+
if not score_type:
61+
score_type = "cde_score" if score_card["cde_score"] and not score_card["score"] else "score"
6062
if not drilldown:
6163
score_breakdown = ScoreDefinitionBreakdownItem.filter(
6264
definition_id=definition_id,

0 commit comments

Comments
 (0)