Align DataFrame::fill_null column argument with fill_nan#22904
Open
Nagato-Yuzuru wants to merge 1 commit into
Open
Align DataFrame::fill_null column argument with fill_nan#22904Nagato-Yuzuru wants to merge 1 commit into
Nagato-Yuzuru wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
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_nullto accept&ScalarValueand&[&str]instead of owned types - Updated Rustdoc examples and the 55.0.0 upgrade guide with migration instructions
- Adjusted dataframe tests to call
fill_nullwith 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"])?; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
DataFrame::fill_nullcolumn argument withfill_nan#22806 .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.