Skip to content

Commit 0c76607

Browse files
committed
test: avoid ? operators in unsupported distinct handling test to fix Codecov partial branches
1 parent 1c0e7c0 commit 0c76607

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

‎datafusion/optimizer/src/single_distinct_to_groupby.rs‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,8 +1298,8 @@ mod tests {
12981298
}
12991299

13001300
#[test]
1301-
fn test_unsupported_distinct_handling_is_not_rewritten() -> Result<()> {
1302-
let table_scan = test_table_scan()?;
1301+
fn test_unsupported_distinct_handling_is_not_rewritten() {
1302+
let table_scan = test_table_scan().unwrap();
13031303

13041304
// approx_median returns DistinctHandling::Unsupported
13051305
let aggr_expr = Expr::AggregateFunction(AggregateFunction::new_udf(
@@ -1312,8 +1312,10 @@ mod tests {
13121312
));
13131313

13141314
let plan = LogicalPlanBuilder::from(table_scan)
1315-
.aggregate(vec![col("a")], vec![aggr_expr])?
1316-
.build()?;
1315+
.aggregate(vec![col("a")], vec![aggr_expr])
1316+
.unwrap()
1317+
.build()
1318+
.unwrap();
13171319

13181320
// The rule should rewrite the plan because approx_median doesn't support DISTINCT natively,
13191321
// so it requires SingleDistinctToGroupBy to deduplicate the input.
@@ -1328,6 +1330,6 @@ mod tests {
13281330
Aggregate: groupBy=[[test.a, test.b AS alias1]], aggr=[[]] [a:UInt32, alias1:UInt32]
13291331
TableScan: test [a:UInt32, b:UInt32, c:UInt32]
13301332
",
1331-
)
1333+
).unwrap();
13321334
}
13331335
}

0 commit comments

Comments
 (0)