Skip to content

Commit 54bbdf8

Browse files
timsaucerclaude
andcommitted
refactor(udwf): drop redundant PythonFunctionWindowUDF::from_parts
`from_parts` was a verbatim wrapper over `new` with an identical signature, kept only for parity with the scalar / aggregate variants where `from_parts` accepts richer state (return `Field`, state `Vec<FieldRef>`) than `new`. Window UDFs have no such asymmetry, so the indirection added no value. Call `PythonFunctionWindowUDF::new` from the codec directly. Same behavior, one fewer hop. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 5762435 commit 54bbdf8

2 files changed

Lines changed: 1 addition & 11 deletions

File tree

crates/core/src/codec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ fn decode_python_window_udf(py: Python<'_>, payload: &[u8]) -> PyResult<PythonFu
744744
let volatility = datafusion_python_util::parse_volatility(&volatility_str)
745745
.map_err(|e| pyo3::exceptions::PyValueError::new_err(format!("{e}")))?;
746746

747-
Ok(PythonFunctionWindowUDF::from_parts(
747+
Ok(PythonFunctionWindowUDF::new(
748748
name,
749749
evaluator,
750750
input_types,

crates/core/src/udwf.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -311,16 +311,6 @@ impl PythonFunctionWindowUDF {
311311
pub(crate) fn return_type(&self) -> &DataType {
312312
&self.return_type
313313
}
314-
315-
pub(crate) fn from_parts(
316-
name: String,
317-
evaluator: Py<PyAny>,
318-
input_types: Vec<DataType>,
319-
return_type: DataType,
320-
volatility: Volatility,
321-
) -> Self {
322-
Self::new(name, evaluator, input_types, return_type, volatility)
323-
}
324314
}
325315

326316
impl Eq for PythonFunctionWindowUDF {}

0 commit comments

Comments
 (0)