refactor: unify data preparations and research input snapshots
Deploy production / deploy (push) Successful in 53s

This commit is contained in:
yuxuanhui
2026-09-12 01:24:02 +08:00
parent 849f86fef7
commit 394438e753
82 changed files with 4146 additions and 2076 deletions
+9 -10
View File
@@ -1,3 +1,4 @@
import { choosePreparation } from "./preparation-helpers";
import { expect, test } from "@playwright/test";
const headers = { "X-WQ-Request": "1" };
const scope = {
@@ -50,13 +51,12 @@ test("feature conversion, saved views and immutable evaluations", async ({
await page.request.get(`/api/v1/catalog/datasets/TEST_FIN/fields?${params}`)
).json();
const fixed = await (
await page.request.post("/api/v1/catalog/inputs", {
await page.request.post("/api/v1/data-preparations/from-dataset", {
headers,
data: {
scope,
dataset_id: "TEST_FIN",
collection_version: fields.collection_version,
selection: "all",
},
})
).json();
@@ -67,11 +67,7 @@ test("feature conversion, saved views and immutable evaluations", async ({
await page
.getByLabel("特征经济假设", { exact: true })
.fill("排名可降低异常值影响");
await page.getByRole("combobox", { name: "特征固定输入" }).click();
await page
.getByRole("option")
.filter({ hasText: fixed.id.slice(0, 8) })
.click();
await choosePreparation(page, fixed.name, "选择特征数据准备");
await page.getByLabel("特征方案名称", { exact: true }).click();
await page.getByRole("button", { name: "添加处理步骤" }).click();
await page.getByLabel("步骤 1 名称").fill("横截面排名");
@@ -95,9 +91,12 @@ test("feature conversion, saved views and immutable evaluations", async ({
"/api/v1/research/assets?kind=template&q=特征转换模板",
)
).json();
expect(templates.items[0].provenance.feature.content.input_ids).toEqual([
fixed.id,
]);
const snapshot = await (
await page.request.get(
`/api/v1/research/input-snapshots/${templates.items[0].provenance.feature.content.input_ids[0]}`,
)
).json();
expect(snapshot.preparation_id).toBe(fixed.id);
await page.keyboard.press("Escape");
await page.getByRole("button", { name: "Alpha 管理", exact: true }).click();
await page.getByRole("button", { name: "保存为新视图" }).click();