james-willis commented on code in PR #1146:
URL: https://github.com/apache/sedona-db/pull/1146#discussion_r3778618927
##########
python/sedonadb/src/import_from.rs:
##########
@@ -211,3 +256,97 @@ pub fn check_pycapsule(obj: &Bound<PyAny>, name: &str) ->
Result<*mut c_void, Py
Ok(pointer.as_ptr())
}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+ use arrow_schema::DataType;
+ use sedona_expr::scalar_udf::SimpleSedonaScalarKernel;
+ use sedona_extension::{extension::SedonaCScalarKernel,
scalar_kernel::ExportedScalarKernel};
+
+ /// A trivial real kernel (matches any single numeric arg, returns it
+ /// unchanged), exported to a `SedonaCScalarKernel` and wrapped in a real
+ /// `PyCapsule` -- the exact same export path `sedona-extension`'s own
+ /// `ffi_roundtrip`/`named_kernel` tests already prove correct end to
+ /// end. `#[dev-dependencies] pyo3 = { features = ["auto-initialize"] }`
+ /// is what makes `Python::attach` usable here at all: `extension-module`
+ /// (needed for the real wheel build) is only ever added by maturin's own
+ /// build flags, never by this crate's Cargo.toml, so it's never present
+ /// during `cargo test`.
+ fn capsule_with_named_kernel<'py>(
Review Comment:
added the test.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]