Skip to content

Align DataFrame::fill_null column argument with fill_nan#22904

Open
Nagato-Yuzuru wants to merge 1 commit into
apache:mainfrom
Nagato-Yuzuru:issue/22806
Open

Align DataFrame::fill_null column argument with fill_nan#22904
Nagato-Yuzuru wants to merge 1 commit into
apache:mainfrom
Nagato-Yuzuru:issue/22806

Conversation

@Nagato-Yuzuru

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

What changes are included in this PR?

Dataframe::fill_null to take its arguments by reference (&scalarvalue, &[&str]) instead of by value, aligning its signature with fill_nan. Documented the migration in.

Are there any user-facing changes?

This is a breaking change to the public DataFrame::fill_null API.

Copilot AI review requested due to automatic review settings June 11, 2026 09:06
@github-actions github-actions Bot added documentation Improvements or additions to documentation core Core DataFusion crate labels Jun 11, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates the DataFrame::fill_null API to borrow inputs (aligned with fill_nan) and refreshes docs/tests to match the new signature.

Changes:

  • Changed DataFrame::fill_null to accept &ScalarValue and &[&str] instead of owned types
  • Updated Rustdoc examples and the 55.0.0 upgrade guide with migration instructions
  • Adjusted dataframe tests to call fill_null with borrowed arguments

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
docs/source/library-user-guide/upgrading/55.0.0.md Adds an upgrade note + migration examples for the borrowed fill_null signature
datafusion/core/tests/dataframe/mod.rs Updates tests to use borrowed ScalarValue and &str slices
datafusion/core/src/dataframe/mod.rs Changes the public fill_null signature and updates Rustdoc examples

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +66 to +67
let df = df.fill_null(&ScalarValue::from(0), &["a", "c"])?;
let df = df.fill_null(&ScalarValue::from(0), &[])?;
Comment on lines +2467 to +2468
pub fn fill_null(&self, value: &ScalarValue, columns: &[&str]) -> Result<DataFrame> {
self.fill_columns(value, columns, &coalesce(), |_| true)
Comment on lines +6475 to +6476
.fill_null(&ScalarValue::Int32(Some(0)), &["a"])?
.fill_null(&ScalarValue::Utf8(Some("default".to_string())), &["b"])?;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core DataFusion crate documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Align DataFrame::fill_null column argument with fill_nan

2 participants