Sorting changes

This commit is contained in:
2026-05-17 14:43:09 +02:00
parent 574349b929
commit b5a3a715a4
10 changed files with 276 additions and 36 deletions
+16 -2
View File
@@ -507,6 +507,12 @@ func configuredPartsRowsACBonusValue(rowID int, datasetName string, cfg project.
return "", false
}
switch strings.TrimSpace(policy.Strategy) {
case "ascending_row_id_sort_key":
format := strings.TrimSpace(policy.Format)
if format == "" {
format = "%.2f"
}
return fmt.Sprintf(format, float64(rowID)/float64(policy.Divisor)), true
case "descending_row_id_sort_key":
format := strings.TrimSpace(policy.Format)
if format == "" {
@@ -655,9 +661,17 @@ func augmentWithAutogeneratedPartsWithConfig(collected []nativeCollectedDataset,
}
}
// Add rows for discovered IDs that don't already exist
// Add rows for discovered IDs that don't already exist.
newRows := make([]map[string]any, 0, len(dataset.Rows))
newRows = append(newRows, dataset.Rows...)
for _, row := range dataset.Rows {
rowID, ok := row["id"].(int)
if cfg.NullUndiscoveredRows && ok {
if _, discovered := ids[rowID]; !discovered {
continue
}
}
newRows = append(newRows, row)
}
for rowID := range ids {
if row, exists := existingRows[rowID]; exists {