From be45dbcabcffacdd0fe62557d0f8d6906b76dd31 Mon Sep 17 00:00:00 2001 From: Vincent <1729065730@qq.com> Date: Thu, 29 Oct 2026 13:23:28 +0800 Subject: [PATCH] feat: make Python UDF wire-format family prefixes public Expose PY_SCALAR_UDF_FAMILY, PY_AGG_UDF_FAMILY, and PY_WINDOW_UDF_FAMILY so downstream consumers (e.g. Ballista's Python client) can recognise inline Python UDF payloads without duplicating the magic bytes. Closes #1817. --- crates/core/src/codec.rs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/crates/core/src/codec.rs b/crates/core/src/codec.rs index cca45147d..007a62a39 100644 --- a/crates/core/src/codec.rs +++ b/crates/core/src/codec.rs @@ -143,18 +143,30 @@ use crate::udwf::PythonFunctionWindowUDF; /// Family prefix for an inlined Python scalar UDF /// (cloudpickled tuple of name, callable, input schema, return field, /// volatility). -pub(crate) const PY_SCALAR_UDF_FAMILY: &[u8] = b"DFPYUDF"; +/// +/// Public wire-format family registry entry for downstream consumers +/// (e.g. Ballista's Python client) that need to recognise inline +/// Python UDF payloads without duplicating these magic bytes. +pub const PY_SCALAR_UDF_FAMILY: &[u8] = b"DFPYUDF"; /// Family prefix for an inlined Python aggregate UDF /// (cloudpickled tuple of name, accumulator factory, input schema bytes, /// return schema bytes (single-field IPC schema), state schema bytes, /// volatility). -pub(crate) const PY_AGG_UDF_FAMILY: &[u8] = b"DFPYUDA"; +/// +/// Public wire-format family registry entry for downstream consumers +/// (e.g. Ballista's Python client) that need to recognise inline +/// Python UDF payloads without duplicating these magic bytes. +pub const PY_AGG_UDF_FAMILY: &[u8] = b"DFPYUDA"; /// Family prefix for an inlined Python window UDF /// (cloudpickled tuple of name, evaluator factory, input schema bytes, /// return schema bytes (single-field IPC schema), volatility). -pub(crate) const PY_WINDOW_UDF_FAMILY: &[u8] = b"DFPYUDW"; +/// +/// Public wire-format family registry entry for downstream consumers +/// (e.g. Ballista's Python client) that need to recognise inline +/// Python UDF payloads without duplicating these magic bytes. +pub const PY_WINDOW_UDF_FAMILY: &[u8] = b"DFPYUDW"; /// Wire-format version this build emits. pub(crate) const WIRE_VERSION_CURRENT: u8 = 1;