Skip to content

Commit be45dbc

Browse files
committed
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.
1 parent 878e5d3 commit be45dbc

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

‎crates/core/src/codec.rs‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,18 +143,30 @@ use crate::udwf::PythonFunctionWindowUDF;
143143
/// Family prefix for an inlined Python scalar UDF
144144
/// (cloudpickled tuple of name, callable, input schema, return field,
145145
/// volatility).
146-
pub(crate) const PY_SCALAR_UDF_FAMILY: &[u8] = b"DFPYUDF";
146+
///
147+
/// Public wire-format family registry entry for downstream consumers
148+
/// (e.g. Ballista's Python client) that need to recognise inline
149+
/// Python UDF payloads without duplicating these magic bytes.
150+
pub const PY_SCALAR_UDF_FAMILY: &[u8] = b"DFPYUDF";
147151

148152
/// Family prefix for an inlined Python aggregate UDF
149153
/// (cloudpickled tuple of name, accumulator factory, input schema bytes,
150154
/// return schema bytes (single-field IPC schema), state schema bytes,
151155
/// volatility).
152-
pub(crate) const PY_AGG_UDF_FAMILY: &[u8] = b"DFPYUDA";
156+
///
157+
/// Public wire-format family registry entry for downstream consumers
158+
/// (e.g. Ballista's Python client) that need to recognise inline
159+
/// Python UDF payloads without duplicating these magic bytes.
160+
pub const PY_AGG_UDF_FAMILY: &[u8] = b"DFPYUDA";
153161

154162
/// Family prefix for an inlined Python window UDF
155163
/// (cloudpickled tuple of name, evaluator factory, input schema bytes,
156164
/// return schema bytes (single-field IPC schema), volatility).
157-
pub(crate) const PY_WINDOW_UDF_FAMILY: &[u8] = b"DFPYUDW";
165+
///
166+
/// Public wire-format family registry entry for downstream consumers
167+
/// (e.g. Ballista's Python client) that need to recognise inline
168+
/// Python UDF payloads without duplicating these magic bytes.
169+
pub const PY_WINDOW_UDF_FAMILY: &[u8] = b"DFPYUDW";
158170

159171
/// Wire-format version this build emits.
160172
pub(crate) const WIRE_VERSION_CURRENT: u8 = 1;

0 commit comments

Comments
 (0)