Skip to content

Commit 412029c

Browse files
committed
refactor: update fill_null to use py_obj_to_scalar_value from utils
1 parent ecc4376 commit 412029c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/dataframe.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ use crate::expr::sort_expr::to_sort_expressions;
4747
use crate::physical_plan::PyExecutionPlan;
4848
use crate::record_batch::PyRecordBatchStream;
4949
use crate::sql::logical::PyLogicalPlan;
50-
use crate::utils::{get_tokio_runtime, validate_pycapsule, wait_for_future};
50+
use crate::utils::{
51+
get_tokio_runtime, py_obj_to_scalar_value, validate_pycapsule, wait_for_future,
52+
};
5153
use crate::{
5254
errors::PyDataFusionResult,
5355
expr::{sort_expr::PySortExpr, PyExpr},
@@ -714,11 +716,11 @@ impl PyDataFrame {
714716
#[pyo3(signature = (value, columns=None))]
715717
fn fill_null(
716718
&self,
717-
value: PyAny,
719+
value: PyObject,
718720
columns: Option<Vec<PyBackedStr>>,
719721
py: Python,
720722
) -> PyDataFusionResult<Self> {
721-
let scalar_value = python_value_to_scalar_value(&value, py)?;
723+
let scalar_value = py_obj_to_scalar_value(py, value);
722724

723725
let cols = match columns {
724726
Some(col_names) => col_names.iter().map(|c| c.to_string()).collect(),

0 commit comments

Comments
 (0)