Sorting changes
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user