timsaucer opened a new pull request, #1568:
URL: https://github.com/apache/datafusion-python/pull/1568

   # Which issue does this PR close?
   
   Closes #. No tracking issue; gap surfaced during the v54 upstream coverage 
audit.
   
   # Rationale for this change
   
   Five scalar functions from `datafusion::functions::expr_fn` (DataFusion 54) 
were not exposed through the Python bindings. They round out the Arrow 
type-introspection and casting surface alongside the existing `arrow_typeof`, 
`arrow_cast`, and `arrow_metadata` wrappers.
   
   # What changes are included in this PR?
   
   - `crates/core/src/functions.rs`: add `arrow_field`, `arrow_try_cast`, 
`cast_to_type`, `try_cast_to_type`, and `with_metadata` via the existing 
`expr_fn!` / `expr_fn_vec!` macros, with module registrations.
   - `python/datafusion/functions.py`: add Python wrappers with doctest 
examples and `__all__` entries. The two upstream functions `cast_to_type` and 
`try_cast_to_type` are combined into a single Python entry point 
`cast_to_type(value, type_ref, *, try_cast=False)`; passing `try_cast=True` 
dispatches to `try_cast_to_type`. `arrow_try_cast` mirrors the existing 
`arrow_cast` argument handling for `Expr` and `str` data-type arguments. 
`with_metadata` accepts a `dict[str, str]` for ergonomics and expands it to 
alternating key/value string literals at the FFI boundary.
   - `skills/datafusion_python/SKILL.md`: list the new functions and document 
the `cast_to_type` kwarg behavior so users understand the single-entry-point 
design.
   
   # Are there any user-facing changes?
   
   Yes. Five new public functions in `datafusion.functions`:
   
   - `arrow_field(expr)`
   - `arrow_try_cast(expr, data_type)`
   - `cast_to_type(value, type_ref, *, try_cast=False)`
   - `with_metadata(expr, metadata)`
   
   No breaking changes.


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to