Commit 152ef81
feat: expose arrow_field, arrow_try_cast, cast_to_type, with_metadata
Adds Python bindings for five scalar functions from
datafusion::functions::expr_fn that were not previously surfaced:
- arrow_field: returns a struct describing an expression's Arrow field
(name, data_type, nullable, metadata).
- arrow_try_cast: like arrow_cast but yields NULL on cast failure.
- cast_to_type / try_cast_to_type: casts a value to the type of a
reference expression. These are exposed as a single Python entry
point cast_to_type(value, type_ref, *, try_cast=False); the kwarg
switches between the strict and try variants.
- with_metadata: attach Arrow field metadata; the inverse of
arrow_metadata. Accepts a dict[str, str] for ergonomics.
Updates skills/datafusion_python/SKILL.md to list the new functions
and documents the cast_to_type kwarg behavior.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent d021e6a commit 152ef81
3 files changed
Lines changed: 123 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
607 | 607 | | |
608 | 608 | | |
609 | 609 | | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
610 | 614 | | |
| 615 | + | |
611 | 616 | | |
612 | 617 | | |
613 | 618 | | |
| |||
962 | 967 | | |
963 | 968 | | |
964 | 969 | | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
965 | 974 | | |
| 975 | + | |
966 | 976 | | |
967 | 977 | | |
968 | 978 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
123 | 124 | | |
| 125 | + | |
124 | 126 | | |
125 | 127 | | |
126 | 128 | | |
| |||
138 | 140 | | |
139 | 141 | | |
140 | 142 | | |
| 143 | + | |
141 | 144 | | |
142 | 145 | | |
143 | 146 | | |
| |||
368 | 371 | | |
369 | 372 | | |
370 | 373 | | |
| 374 | + | |
371 | 375 | | |
372 | 376 | | |
373 | 377 | | |
| |||
2930 | 2934 | | |
2931 | 2935 | | |
2932 | 2936 | | |
| 2937 | + | |
| 2938 | + | |
| 2939 | + | |
| 2940 | + | |
| 2941 | + | |
| 2942 | + | |
| 2943 | + | |
| 2944 | + | |
| 2945 | + | |
| 2946 | + | |
| 2947 | + | |
| 2948 | + | |
| 2949 | + | |
| 2950 | + | |
| 2951 | + | |
| 2952 | + | |
| 2953 | + | |
| 2954 | + | |
| 2955 | + | |
| 2956 | + | |
| 2957 | + | |
| 2958 | + | |
| 2959 | + | |
| 2960 | + | |
| 2961 | + | |
| 2962 | + | |
| 2963 | + | |
| 2964 | + | |
| 2965 | + | |
| 2966 | + | |
| 2967 | + | |
| 2968 | + | |
| 2969 | + | |
| 2970 | + | |
| 2971 | + | |
| 2972 | + | |
| 2973 | + | |
| 2974 | + | |
| 2975 | + | |
| 2976 | + | |
| 2977 | + | |
| 2978 | + | |
| 2979 | + | |
| 2980 | + | |
| 2981 | + | |
| 2982 | + | |
| 2983 | + | |
| 2984 | + | |
| 2985 | + | |
| 2986 | + | |
| 2987 | + | |
| 2988 | + | |
| 2989 | + | |
| 2990 | + | |
| 2991 | + | |
| 2992 | + | |
| 2993 | + | |
| 2994 | + | |
| 2995 | + | |
| 2996 | + | |
| 2997 | + | |
| 2998 | + | |
| 2999 | + | |
| 3000 | + | |
| 3001 | + | |
| 3002 | + | |
| 3003 | + | |
| 3004 | + | |
| 3005 | + | |
| 3006 | + | |
| 3007 | + | |
| 3008 | + | |
| 3009 | + | |
| 3010 | + | |
| 3011 | + | |
| 3012 | + | |
2933 | 3013 | | |
2934 | 3014 | | |
2935 | 3015 | | |
| |||
2963 | 3043 | | |
2964 | 3044 | | |
2965 | 3045 | | |
| 3046 | + | |
| 3047 | + | |
| 3048 | + | |
| 3049 | + | |
| 3050 | + | |
| 3051 | + | |
| 3052 | + | |
| 3053 | + | |
| 3054 | + | |
| 3055 | + | |
| 3056 | + | |
| 3057 | + | |
| 3058 | + | |
| 3059 | + | |
| 3060 | + | |
| 3061 | + | |
| 3062 | + | |
| 3063 | + | |
| 3064 | + | |
| 3065 | + | |
| 3066 | + | |
| 3067 | + | |
| 3068 | + | |
| 3069 | + | |
| 3070 | + | |
| 3071 | + | |
| 3072 | + | |
2966 | 3073 | | |
2967 | 3074 | | |
2968 | 3075 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
758 | 758 | | |
759 | 759 | | |
760 | 760 | | |
761 | | - | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
762 | 767 | | |
763 | 768 | | |
764 | 769 | | |
0 commit comments