Skip to content

Commit b692905

Browse files
authored
models/feature: Add iteration limit warning (#9580)
1 parent 828f52e commit b692905

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/models/feature.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub fn split_features(features: FeaturesMap) -> (FeaturesMap, FeaturesMap) {
2222

2323
// Then, we recursively move features from `features` to `features2` if they
2424
// depend on features in `features2`.
25-
for _ in 0..ITERATION_LIMIT {
25+
for i in (0..ITERATION_LIMIT).rev() {
2626
let split = features
2727
.into_iter()
2828
.partition::<FeaturesMap, _>(|(_k, vals)| {
@@ -33,6 +33,10 @@ pub fn split_features(features: FeaturesMap) -> (FeaturesMap, FeaturesMap) {
3333

3434
if !split.1.is_empty() {
3535
features2.extend(split.1);
36+
37+
if i == 0 {
38+
warn!("Iteration limit reached while splitting features!");
39+
}
3640
} else {
3741
break;
3842
}

0 commit comments

Comments
 (0)