Skip to content

Commit 2820c07

Browse files
author
ci bot
committed
Merge branch 'qa-fixes' into 'enterprise'
misc qa fixes See merge request dkinternal/testgen/dataops-testgen!263
2 parents bc88cd5 + aa6007e commit 2820c07

6 files changed

Lines changed: 19 additions & 5 deletions

File tree

testgen/ui/components/frontend/css/shared.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ body {
149149
border: var(--button-stroked-border);
150150
border-radius: 8px;
151151
padding: 16px;
152+
box-sizing: border-box;
152153
}
153154

154155
.table-row {

testgen/ui/components/frontend/js/pages/project_dashboard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ const TableGroupCard = (/** @type TableGroupSummary */ tableGroup) => {
157157
),
158158
span(
159159
{ class: 'text-caption mt-1 mb-3 tg-overview--subtitle' },
160-
`${tableGroup.latest_profile_table_ct} tables | ${tableGroup.latest_profile_column_ct} columns`,
160+
`${tableGroup.latest_profile_table_ct ?? 0} tables | ${tableGroup.latest_profile_column_ct ?? 0} columns`,
161161
),
162162
TableGroupTestSuiteSummary(tableGroup.test_suites),
163163
),

testgen/ui/components/frontend/js/pages/schedule_list.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import van from '../van.min.js';
2020
import { Button } from '../components/button.js';
2121
import { Streamlit } from '../streamlit.js';
22-
import { emitEvent, getValue, resizeFrameHeightToElement } from '../utils.js';
22+
import { emitEvent, getValue, resizeFrameHeightToElement, resizeFrameHeightOnDOMChange } from '../utils.js';
2323
import { withTooltip } from '../components/tooltip.js';
2424

2525

@@ -42,6 +42,7 @@ const ScheduleList = (/** @type Properties */ props) => {
4242

4343
const tableId = 'profiling-schedules-table';
4444
resizeFrameHeightToElement(tableId);
45+
resizeFrameHeightOnDOMChange(tableId);
4546

4647
return div(
4748
{ class: 'table', id: tableId },

testgen/ui/components/frontend/js/pages/table_group_list.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ const Toolbar = (permissions, connections, selectedConnection) => {
222222
})) ?? [],
223223
onChange: (value) => emitEvent('ConnectionSelected', { payload: value }),
224224
})
225-
: undefined,
225+
: span(''),
226226
div(
227227
{ class: 'flex-row fx-gap-4' },
228228
Button({

testgen/ui/services/form_service.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import json
12
import typing
23
from builtins import float
34
from pathlib import Path
@@ -312,7 +313,7 @@ def render_grid_select(
312313
enable_enterprise_modules=False,
313314
allow_unsafe_jscode=True,
314315
update_mode=GridUpdateMode.NO_UPDATE,
315-
update_on=["selectionChanged", "modelUpdated"],
316+
update_on=["selectionChanged"],
316317
data_return_mode=DataReturnMode.FILTERED_AND_SORTED,
317318
columns_auto_size_mode=ColumnsAutoSizeMode.FIT_CONTENTS,
318319
height=int_height,
@@ -332,4 +333,13 @@ def render_grid_select(
332333
if len(selected_rows) > 0:
333334
if bind_to_query_name and bind_to_query_prop:
334335
Router().set_query_params({bind_to_query_name: selected_rows[0][bind_to_query_prop]})
336+
337+
# We need to get the data from the original dataframe
338+
# Otherwise changes to the dataframe (e.g., editing the current selection) do not get reflected in the returned rows
339+
# Adding "modelUpdated" to AgGrid(update_on=...) does not work
340+
# because it causes unnecessary reruns that cause dialogs to close abruptly
341+
selected_props = [row[bind_to_query_prop] for row in selected_rows]
342+
selected_df = df[df[bind_to_query_prop].isin(selected_props)]
343+
selected_rows = json.loads(selected_df.to_json(orient="records"))
344+
335345
return selected_rows

testgen/ui/views/profiling_results.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import testgen.ui.services.database_service as db
1111
import testgen.ui.services.form_service as fm
1212
from testgen.common import date_service
13+
from testgen.common.models import with_database_session
1314
from testgen.ui.components import widgets as testgen
1415
from testgen.ui.components.widgets.download_dialog import (
1516
FILE_DATA_TYPE,
@@ -171,6 +172,7 @@ def open_download_dialog(data: pd.DataFrame | None = None) -> None:
171172
)
172173

173174

175+
@with_database_session
174176
def get_excel_report_data(
175177
update_progress: PROGRESS_UPDATE_TYPE,
176178
table_group: str,
@@ -192,7 +194,7 @@ def get_excel_report_data(
192194

193195
for key in ["min_date", "max_date"]:
194196
data[key] = data[key].apply(
195-
lambda val: datetime.fromtimestamp(val / 1000).strftime("%b %-d %Y, %-I:%M %p") if not pd.isna(val) else None
197+
lambda val: datetime.strptime(val, "%Y-%m-%d %H:%M:%S").strftime("%b %-d %Y, %-I:%M %p") if not pd.isna(val) and val != "NaT" else None
196198
)
197199

198200
data["hygiene_issues"] = data["hygiene_issues"].apply(lambda val: "Yes" if val else None)

0 commit comments

Comments
 (0)