()
| 6455 | |
| 6456 | #[tokio::test] |
| 6457 | async fn test_fill_null() -> Result<()> { |
| 6458 | let df = create_null_table().await?; |
| 6459 | |
| 6460 | // Use fill_null to replace nulls on each column. |
| 6461 | let df_filled = df |
| 6462 | .fill_null(ScalarValue::Int32(Some(0)), vec!["a".to_string()])? |
| 6463 | .fill_null( |
| 6464 | ScalarValue::Utf8(Some("default".to_string())), |
| 6465 | vec!["b".to_string()], |
| 6466 | )?; |
| 6467 | |
| 6468 | let results = df_filled.collect().await?; |
| 6469 | assert_snapshot!( |
| 6470 | batches_to_sort_string(&results), |
| 6471 | @r" |
| 6472 | +---+---------+ |
| 6473 | | a | b | |
| 6474 | +---+---------+ |
| 6475 | | 0 | default | |
| 6476 | | 1 | x | |
| 6477 | | 3 | z | |
| 6478 | +---+---------+ |
| 6479 | " |
| 6480 | ); |
| 6481 | |
| 6482 | Ok(()) |
| 6483 | } |
| 6484 | |
| 6485 | #[tokio::test] |
| 6486 | async fn test_fill_null_all_columns() -> Result<()> { |
nothing calls this directly
no test coverage detected
searching dependent graphs…