feature: multiple ratio configurations can be set for the data set. (#103)

feature: multiple ratio configurations can be set for the data set.
This commit is contained in:
hefanli
2025-11-24 15:28:17 +08:00
committed by GitHub
parent 497a5688e9
commit c1352ab91f
11 changed files with 258 additions and 229 deletions

View File

@@ -20,7 +20,7 @@ import java.util.Map;
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
public class FileTag { public class FileTag {
private Map<String, Object> value; private Map<String, Object> values;
private String type; private String type;
@@ -30,7 +30,7 @@ public class FileTag {
public List<String> getTags() { public List<String> getTags() {
List<String> tags = new ArrayList<>(); List<String> tags = new ArrayList<>();
Object tagValues = value.get(type); Object tagValues = values.get(type);
if (tagValues instanceof List) { if (tagValues instanceof List) {
for (Object tag : (List<?>) tagValues) { for (Object tag : (List<?>) tagValues) {
if (tag instanceof String) { if (tag instanceof String) {

View File

@@ -38,7 +38,7 @@ export default function CreateRatioTask() {
const totals = String(values.totalTargetCount); const totals = String(values.totalTargetCount);
const config = ratioTaskForm.ratioConfigs.map((c) => { const config = ratioTaskForm.ratioConfigs.map((c) => {
return { return {
datasetId: c.id, datasetId: c.source,
counts: String(c.quantity ?? 0), counts: String(c.quantity ?? 0),
filterConditions: { label: c.labelFilter, dateRange: String(c.dateRange ?? 0)}, filterConditions: { label: c.labelFilter, dateRange: String(c.dateRange ?? 0)},
}; };

View File

@@ -1,11 +1,16 @@
import React, { useMemo, useState } from "react"; import React, { useMemo, useState, useEffect, FC } from "react";
import { Badge, Card, Input, Progress, Button, DatePicker, Select } from "antd"; import {
import { BarChart3, Filter, Clock } from "lucide-react"; Badge,
Card,
Progress,
Button,
Select,
Table,
InputNumber,
Space,
} from "antd";
import { BarChart3, Filter } from "lucide-react";
import type { Dataset } from "@/pages/DataManagement/dataset.model.ts"; import type { Dataset } from "@/pages/DataManagement/dataset.model.ts";
import dayjs from 'dayjs';
const { RangePicker } = DatePicker;
const { Option } = Select;
const TIME_RANGE_OPTIONS = [ const TIME_RANGE_OPTIONS = [
{ label: '最近1天', value: 1 }, { label: '最近1天', value: 1 },
@@ -21,9 +26,9 @@ interface RatioConfigItem {
type: "dataset" | "label"; type: "dataset" | "label";
quantity: number; quantity: number;
percentage: number; percentage: number;
source: string; source: string; // dataset id
labelFilter?: string; labelFilter?: string;
dateRange?: string; dateRange?: number;
} }
interface RatioConfigProps { interface RatioConfigProps {
@@ -35,169 +40,113 @@ interface RatioConfigProps {
onChange?: (configs: RatioConfigItem[]) => void; onChange?: (configs: RatioConfigItem[]) => void;
} }
const RatioConfig: React.FC<RatioConfigProps> = ({ const genId = (datasetId: string) =>
ratioType, `${datasetId}-${Math.random().toString(36).slice(2, 9)}`;
selectedDatasets,
datasets, const RatioConfig: FC<RatioConfigProps> = ({
totalTargetCount, ratioType,
distributions, selectedDatasets,
onChange, datasets,
}) => { totalTargetCount,
const [ratioConfigs, setRatioConfigs] = useState<RatioConfigItem[]>([]); distributions,
const [datasetFilters, setDatasetFilters] = useState<Record<string, { onChange,
labelFilter?: string; }) => {
dateRange?: string; const [ratioConfigs, setRatioConfigs] = useState<RatioConfigItem[]>([]);
}>>({});
// 配比项总数
const totalConfigured = useMemo( const totalConfigured = useMemo(
() => ratioConfigs.reduce((sum, c) => sum + (c.quantity || 0), 0), () => ratioConfigs.reduce((sum, c) => sum + (c.quantity || 0), 0),
[ratioConfigs] [ratioConfigs]
); );
// 获取数据集的标签列表
const getDatasetLabels = (datasetId: string): string[] => { const getDatasetLabels = (datasetId: string): string[] => {
const dist = distributions[String(datasetId)] || {}; const dist = distributions[String(datasetId)] || {};
return Object.keys(dist); return Object.keys(dist);
}; };
// 自动平均分配 const addConfig = (datasetId: string) => {
const dataset = datasets.find((d) => String(d.id) === datasetId);
const newConfig: RatioConfigItem = {
id: genId(datasetId),
name: dataset?.name || datasetId,
type: ratioType,
quantity: 0,
percentage: 0,
source: datasetId,
};
const newConfigs = [...ratioConfigs, newConfig];
setRatioConfigs(newConfigs);
onChange?.(newConfigs);
};
const removeConfig = (configId: string) => {
const newConfigs = ratioConfigs.filter((c) => c.id !== configId);
const adjusted = recomputePercentages(newConfigs);
setRatioConfigs(adjusted);
onChange?.(adjusted);
};
const updateConfig = (
configId: string,
updates: Partial<
Pick<RatioConfigItem, "quantity" | "labelFilter" | "dateRange">
>
) => {
const newConfigs = ratioConfigs.map((c) =>
c.id === configId ? { ...c, ...updates } : c
);
const adjusted = recomputePercentages(newConfigs);
setRatioConfigs(adjusted);
onChange?.(adjusted);
};
const recomputePercentages = (configs: RatioConfigItem[]) => {
return configs.map((c) => ({
...c,
percentage:
totalTargetCount > 0
? Math.round((c.quantity / totalTargetCount) * 100)
: 0,
}));
};
const generateAutoRatio = () => { const generateAutoRatio = () => {
const selectedCount = selectedDatasets.length; const selectedCount = selectedDatasets.length;
if (selectedCount === 0) return; if (selectedCount === 0) return;
const baseQuantity = Math.floor(totalTargetCount / selectedCount); const baseQuantity = Math.floor(totalTargetCount / selectedCount);
const remainder = totalTargetCount % selectedCount; const remainder = totalTargetCount % selectedCount;
const newConfigs = selectedDatasets.map((datasetId, index) => {
let newConfigs: RatioConfigItem[] = ratioConfigs.filter(
(c) => !selectedDatasets.includes(c.source)
);
selectedDatasets.forEach((datasetId, index) => {
const dataset = datasets.find((d) => String(d.id) === datasetId); const dataset = datasets.find((d) => String(d.id) === datasetId);
const quantity = baseQuantity + (index < remainder ? 1 : 0); const quantity = baseQuantity + (index < remainder ? 1 : 0);
return { const config: RatioConfigItem = {
id: datasetId, id: genId(datasetId),
name: dataset?.name || datasetId, name: dataset?.name || datasetId,
type: ratioType, type: ratioType,
quantity, quantity,
percentage: Math.round((quantity / totalTargetCount) * 100), percentage: Math.round((quantity / totalTargetCount) * 100),
source: datasetId, source: datasetId,
labelFilter: datasetFilters[datasetId]?.labelFilter,
dateRange: datasetFilters[datasetId]?.dateRange,
}; };
newConfigs.push(config);
}); });
setRatioConfigs(newConfigs); setRatioConfigs(newConfigs);
onChange?.(newConfigs); onChange?.(newConfigs);
}; };
// 更新数据集配比项 useEffect(() => {
const updateDatasetQuantity = (datasetId: string, quantity: number) => { const keep = ratioConfigs.filter((c) =>
setRatioConfigs((prev) => { selectedDatasets.includes(c.source)
const existingIndex = prev.findIndex(
(config) => config.source === datasetId
);
const totalOtherQuantity = prev
.filter((config) => config.source !== datasetId)
.reduce((sum, config) => sum + config.quantity, 0);
const dataset = datasets.find((d) => String(d.id) === datasetId);
const newConfig: RatioConfigItem = {
id: datasetId,
name: dataset?.name || datasetId,
type: ratioType,
quantity: Math.min(quantity, totalTargetCount - totalOtherQuantity),
percentage: Math.round((quantity / totalTargetCount) * 100),
source: datasetId,
labelFilter: datasetFilters[datasetId]?.labelFilter,
dateRange: datasetFilters[datasetId]?.dateRange,
};
let newConfigs;
if (existingIndex >= 0) {
newConfigs = [...prev];
newConfigs[existingIndex] = newConfig;
} else {
newConfigs = [...prev, newConfig];
}
onChange?.(newConfigs);
return newConfigs;
});
};
// 更新筛选条件
const updateFilters = (datasetId: string, updates: {
labelFilter?: string;
dateRange?: [string, string];
}) => {
setDatasetFilters(prev => ({
...prev,
[datasetId]: {
...prev[datasetId],
...updates,
}
}));
};
// 渲染筛选器
const renderFilters = (datasetId: string) => {
const labels = getDatasetLabels(datasetId);
const config = ratioConfigs.find(c => c.source === datasetId);
const filters = datasetFilters[datasetId] || {};
return (
<div className="mb-3 p-2 bg-gray-50 rounded">
<div className="flex items-center gap-2 mb-2">
<Filter size={14} className="text-gray-400" />
<span className="text-xs font-medium"></span>
</div>
<div className="grid grid-cols-1 md:grid-cols-2 gap-3">
<div>
<div className="text-xs text-gray-500 mb-1"></div>
<Select
style={{ width: '100%' }}
placeholder="选择标签"
value={filters.labelFilter}
onChange={(value) => updateFilters(datasetId, { labelFilter: value })}
allowClear
onClear={() => updateFilters(datasetId, { labelFilter: undefined })}
>
{labels.map(label => (
<Option key={label} value={label}>{label}</Option>
))}
</Select>
</div>
<div>
<div className="text-xs text-gray-500 mb-1"></div>
<Select
style={{ width: '100%' }}
placeholder="选择标签更新时间"
value={filters.dateRange}
onChange={(dates) => updateFilters(datasetId, { dateRange: dates })}
allowClear
onClear={() => updateFilters(datasetId, { dateRange: undefined })}
>
{TIME_RANGE_OPTIONS.map(option => (
<Option key={option.value} value={option.value}>
{option.label}
</Option>
))}
</Select>
</div>
</div>
</div>
); );
}; if (keep.length !== ratioConfigs.length) {
const adjusted = recomputePercentages(keep);
// 选中数据集变化时,初始化筛选条件 setRatioConfigs(adjusted);
React.useEffect(() => { onChange?.(adjusted);
const initialFilters: Record<string, any> = {}; }
selectedDatasets.forEach(datasetId => { // eslint-disable-next-line react-hooks/exhaustive-deps
const config = ratioConfigs.find(c => c.source === datasetId);
if (config) {
initialFilters[datasetId] = {
labelFilter: config.labelFilter,
dateRange: config.dateRange,
};
}
});
setDatasetFilters(prev => ({ ...prev, ...initialFilters }));
}, [selectedDatasets]); }, [selectedDatasets]);
return ( return (
@@ -209,15 +158,18 @@ const RatioConfig: React.FC<RatioConfigProps> = ({
(:{totalConfigured}/{totalTargetCount}) (:{totalConfigured}/{totalTargetCount})
</span> </span>
</span> </span>
<Button <div className="flex items-center gap-2">
type="link" <Button
size="small" type="link"
onClick={generateAutoRatio} size="small"
disabled={selectedDatasets.length === 0} onClick={generateAutoRatio}
> disabled={selectedDatasets.length === 0}
>
</Button>
</Button>
</div>
</div> </div>
{selectedDatasets.length === 0 ? ( {selectedDatasets.length === 0 ? (
<div className="text-center py-8 text-gray-500"> <div className="text-center py-8 text-gray-500">
<BarChart3 className="w-12 h-12 mx-auto mb-2 text-gray-300" /> <BarChart3 className="w-12 h-12 mx-auto mb-2 text-gray-300" />
@@ -225,7 +177,6 @@ const RatioConfig: React.FC<RatioConfigProps> = ({
</div> </div>
) : ( ) : (
<div className="flex-overflow-auto gap-4 p-4"> <div className="flex-overflow-auto gap-4 p-4">
{/* 配比预览 */}
{ratioConfigs.length > 0 && ( {ratioConfigs.length > 0 && (
<div className="p-3 bg-gray-50 rounded-lg mb-4"> <div className="p-3 bg-gray-50 rounded-lg mb-4">
<div className="grid grid-cols-2 gap-4 text-sm"> <div className="grid grid-cols-2 gap-4 text-sm">
@@ -250,54 +201,146 @@ const RatioConfig: React.FC<RatioConfigProps> = ({
<div className="flex-1 overflow-auto space-y-4"> <div className="flex-1 overflow-auto space-y-4">
{selectedDatasets.map((datasetId) => { {selectedDatasets.map((datasetId) => {
const dataset = datasets.find((d) => String(d.id) === datasetId); const dataset = datasets.find((d) => String(d.id) === datasetId);
const config = ratioConfigs.find((c) => c.source === datasetId);
const currentQuantity = config?.quantity || 0;
if (!dataset) return null; if (!dataset) return null;
const datasetConfigs = ratioConfigs.filter(
(c) => c.source === datasetId
);
const labels = getDatasetLabels(datasetId);
const usedLabels = datasetConfigs
.map((c) => c.labelFilter)
.filter(Boolean) as string[];
const columns = [
{
title: "配比项",
dataIndex: "id",
key: "id",
render: (_: any, record: RatioConfigItem) => (
<Space>
<Filter size={14} className="text-gray-400" />
<span className="text-sm">{record.name}</span>
</Space>
),
},
{
title: "标签筛选",
dataIndex: "labelFilter",
key: "labelFilter",
render: (_: any, record: RatioConfigItem) => {
const availableLabels = labels
.map((l) => ({ label: l, value: l }))
.filter(
(opt) =>
opt.value === record.labelFilter ||
!usedLabels.includes(opt.value)
);
return (
<Select
style={{ width: "160px" }}
placeholder="选择标签"
value={record.labelFilter}
options={availableLabels}
allowClear
onChange={(value) =>
updateConfig(record.id, {
labelFilter: value || undefined,
})
}
/>
);
},
},
{
title: "标签更新时间",
dataIndex: "dateRange",
key: "dateRange",
render: (_: any, record: RatioConfigItem) => (
<Select
style={{ width: "140px" }}
placeholder="选择标签更新时间"
value={record.dateRange}
options={TIME_RANGE_OPTIONS}
allowClear
onChange={(value) =>
updateConfig(record.id, {
dateRange: value || undefined,
})
}
/>
),
},
{
title: "数量",
dataIndex: "quantity",
key: "quantity",
render: (_: any, record: RatioConfigItem) => (
<InputNumber
min={0}
max={Math.min(dataset.fileCount || 0, totalTargetCount)}
value={record.quantity}
onChange={(v) =>
updateConfig(record.id, { quantity: Number(v || 0) })
}
/>
),
},
{
title: "占比",
dataIndex: "percentage",
key: "percentage",
render: (_: any, record: RatioConfigItem) => (
<div style={{ minWidth: 140 }}>
<div className="text-xs mb-1">
{record.percentage ?? 0}%
</div>
<Progress
percent={record.percentage ?? 0}
size="small"
showInfo={false}
/>
</div>
),
},
{
title: "操作",
dataIndex: "actions",
key: "actions",
render: (_: any, record: RatioConfigItem) => (
<Button danger size="small" onClick={() => removeConfig(record.id)}>
</Button>
),
},
];
return ( return (
<Card key={datasetId} size="small" className="mb-4"> <Card key={datasetId} size="small" className="mb-4">
<div className="flex items-center justify-between mb-3"> <div className="flex items-center justify-between mb-3">
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<span className="font-medium text-sm"> <span className="font-medium text-sm">{dataset.name}</span>
{dataset.name}
</span>
<Badge color="gray">{dataset.fileCount}</Badge> <Badge color="gray">{dataset.fileCount}</Badge>
</div> </div>
<div className="text-xs text-gray-500"> <div className="text-xs text-gray-500">
{config?.percentage || 0}% {datasetConfigs.reduce((s, c) => s + (c.percentage || 0), 0)}%
</div> </div>
</div> </div>
{/* 筛选条件 */} <Table
{renderFilters(datasetId)} dataSource={datasetConfigs}
columns={columns}
<div className="flex items-center gap-2 mb-2"> pagination={false}
<span className="text-xs">:</span> rowKey="id"
<Input
type="number"
value={currentQuantity}
onChange={(e) =>
updateDatasetQuantity(
datasetId,
Number(e.target.value)
)
}
style={{ width: 100 }}
min={0}
max={Math.min(
dataset.fileCount || 0,
totalTargetCount
)}
/>
<span className="text-xs text-gray-500"></span>
</div>
<Progress
percent={Math.round(
(currentQuantity / totalTargetCount) * 100
)}
size="small" size="small"
locale={{ emptyText: "暂无配比项,请添加" }}
/> />
<div className="flex justify-end mt-3">
<Button size="small" onClick={() => addConfig(datasetId)}>
</Button>
</div>
</Card> </Card>
); );
})} })}

View File

@@ -177,11 +177,6 @@ export default function RatioTaskDetail() {
<Badge color={ratioTask.status?.color} text={ratioTask.status?.label} /> <Badge color={ratioTask.status?.color} text={ratioTask.status?.label} />
), ),
}, },
{
key: "type",
label: "配比方式",
children: ratioTask.type || "未知",
},
{ {
key: "createdBy", key: "createdBy",
label: "创建者", label: "创建者",

View File

@@ -95,12 +95,6 @@ export default function RatioTasksPage() {
); );
}, },
}, },
{
title: "配比方式",
dataIndex: "ratio_method",
key: "ratio_method",
width: 120,
},
{ {
title: "目标数量", title: "目标数量",
dataIndex: "totals", dataIndex: "totals",

View File

@@ -28,7 +28,6 @@ class RatioInstance(Base):
name = Column(String(64), nullable=True, comment="名称") name = Column(String(64), nullable=True, comment="名称")
description = Column(Text, nullable=True, comment="描述") description = Column(Text, nullable=True, comment="描述")
target_dataset_id = Column(String(64), nullable=True, comment="模板数据集ID") target_dataset_id = Column(String(64), nullable=True, comment="模板数据集ID")
ratio_method = Column(String(50), nullable=True, comment="配比方式,按标签(TAG),按数据集(DATASET)")
ratio_parameters = Column(JSON, nullable=True, comment="配比参数") ratio_parameters = Column(JSON, nullable=True, comment="配比参数")
merge_method = Column(String(50), nullable=True, comment="合并方式") merge_method = Column(String(50), nullable=True, comment="合并方式")
status = Column(String(20), nullable=True, comment="状态") status = Column(String(20), nullable=True, comment="状态")
@@ -39,7 +38,7 @@ class RatioInstance(Base):
updated_by = Column(String(255), nullable=True, comment="更新者") updated_by = Column(String(255), nullable=True, comment="更新者")
def __repr__(self) -> str: def __repr__(self) -> str:
return f"<RatioInstance(id={self.id}, name={self.name}, method={self.ratio_method}, status={self.status})>" return f"<RatioInstance(id={self.id}, name={self.name}, status={self.status})>"
class RatioRelation(Base): class RatioRelation(Base):

View File

@@ -27,15 +27,15 @@ class PagedDatasetFileResponse(BaseModel):
size: int = Field(..., description="每页大小") size: int = Field(..., description="每页大小")
class DatasetFileTag(BaseModel): class DatasetFileTag(BaseModel):
id: str = Field(..., description="标签ID") id: str = Field(None, description="标签ID")
type: str = Field(..., description="类型") type: str = Field(None, description="类型")
from_name: str = Field(..., description="标签名称") from_name: str = Field(None, description="标签名称")
value: dict = Field(..., description="标签值") values: dict = Field(None, description="标签值")
def get_tags(self) -> List[str]: def get_tags(self) -> List[str]:
tags = [] tags = []
# 如果 value 是字典类型,根据 type 获取对应的值 # 如果 values 是字典类型,根据 type 获取对应的值
tag_values = self.value.get(self.type, []) tag_values = self.values.get(self.type, [])
# 处理标签值 # 处理标签值
if isinstance(tag_values, list): if isinstance(tag_values, list):

View File

@@ -170,7 +170,6 @@ async def list_ratio_tasks(
description=i.description, description=i.description,
status=i.status, status=i.status,
totals=i.totals, totals=i.totals,
ratio_method=i.ratio_method,
target_dataset_id=i.target_dataset_id, target_dataset_id=i.target_dataset_id,
target_dataset_name=(ds.name if ds else None), target_dataset_name=(ds.name if ds else None),
created_at=str(i.created_at) if getattr(i, "created_at", None) else None, created_at=str(i.created_at) if getattr(i, "created_at", None) else None,
@@ -330,7 +329,6 @@ async def get_ratio_task(
description=instance.description, description=instance.description,
status=instance.status or "UNKNOWN", status=instance.status or "UNKNOWN",
totals=instance.totals or 0, totals=instance.totals or 0,
ratio_method=instance.ratio_method or "",
config=config, config=config,
target_dataset=target_dataset_info, target_dataset=target_dataset_info,
created_at=instance.created_at, created_at=instance.created_at,

View File

@@ -88,7 +88,6 @@ class RatioTaskItem(BaseModel):
description: Optional[str] = None description: Optional[str] = None
status: Optional[str] = None status: Optional[str] = None
totals: Optional[int] = None totals: Optional[int] = None
ratio_method: Optional[str] = None
target_dataset_id: Optional[str] = None target_dataset_id: Optional[str] = None
target_dataset_name: Optional[str] = None target_dataset_name: Optional[str] = None
created_at: Optional[str] = None created_at: Optional[str] = None
@@ -110,7 +109,6 @@ class RatioTaskDetailResponse(BaseModel):
description: Optional[str] = Field(None, description="任务描述") description: Optional[str] = Field(None, description="任务描述")
status: str = Field(..., description="任务状态") status: str = Field(..., description="任务状态")
totals: int = Field(..., description="目标总数") totals: int = Field(..., description="目标总数")
ratio_method: str = Field(..., description="配比方式")
config: List[Dict[str, Any]] = Field(..., description="配比配置") config: List[Dict[str, Any]] = Field(..., description="配比配置")
target_dataset: Dict[str, Any] = Field(..., description="目标数据集信息") target_dataset: Dict[str, Any] = Field(..., description="目标数据集信息")
created_at: Optional[datetime] = Field(None, description="创建时间") created_at: Optional[datetime] = Field(None, description="创建时间")

View File

@@ -1,3 +1,4 @@
from datetime import datetime
from typing import List, Optional, Dict, Any from typing import List, Optional, Dict, Any
import random import random
import json import json
@@ -173,7 +174,7 @@ class RatioTaskService:
@staticmethod @staticmethod
async def handle_selected_file(existing_paths: set[Any], f, session, target_ds: Dataset): async def handle_selected_file(existing_paths: set[Any], f, session, target_ds: Dataset):
src_path = f.file_path src_path = f.file_path
dst_prefix = f"/dataset/{target_ds.id}" dst_prefix = f"/dataset/{target_ds.id}/"
file_name = RatioTaskService.get_new_file_name(dst_prefix, existing_paths, f) file_name = RatioTaskService.get_new_file_name(dst_prefix, existing_paths, f)
new_path = dst_prefix + file_name new_path = dst_prefix + file_name
@@ -181,18 +182,20 @@ class RatioTaskService:
await asyncio.to_thread(os.makedirs, dst_dir, exist_ok=True) await asyncio.to_thread(os.makedirs, dst_dir, exist_ok=True)
await asyncio.to_thread(shutil.copy2, src_path, new_path) await asyncio.to_thread(shutil.copy2, src_path, new_path)
new_file = DatasetFiles( file_data = {
dataset_id=target_ds.id, # type: ignore "dataset_id": target_ds.id, # type: ignore
file_name=file_name, "file_name": file_name,
file_path=new_path, "file_path": new_path,
file_type=f.file_type, "file_type": f.file_type,
file_size=f.file_size, "file_size": f.file_size,
check_sum=f.check_sum, "check_sum": f.check_sum,
tags=f.tags, "tags": f.tags,
dataset_filemetadata=f.dataset_filemetadata, "tags_updated_at": datetime.now(),
status="ACTIVE", "dataset_filemetadata": f.dataset_filemetadata,
) "status": "ACTIVE",
session.add(new_file) }
file_record = {k: v for k, v in file_data.items() if v is not None}
session.add(DatasetFiles(**file_record))
existing_paths.add(new_path) existing_paths.add(new_path)
@staticmethod @staticmethod

View File

@@ -6,7 +6,6 @@ CREATE TABLE IF NOT EXISTS t_st_ratio_instances
name varchar(64) COMMENT '名称', name varchar(64) COMMENT '名称',
description TEXT COMMENT '描述', description TEXT COMMENT '描述',
target_dataset_id varchar(64) COMMENT '模板数据集ID', target_dataset_id varchar(64) COMMENT '模板数据集ID',
ratio_method varchar(50) COMMENT '配比方式,按标签(TAG),按数据集(DATASET)',
ratio_parameters JSON COMMENT '配比参数', ratio_parameters JSON COMMENT '配比参数',
merge_method varchar(50) COMMENT '合并方式', merge_method varchar(50) COMMENT '合并方式',
status varchar(20) COMMENT '状态', status varchar(20) COMMENT '状态',