File tree 1 file changed +4
-1
lines changed
1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 4
4
<img src="https://img.shields.io/crates/v/pyo3-polars.svg"/>
5
5
</a >
6
6
7
+ Documentation for this functionality may also be found in the [ Polars User Guide] ( https://docs.pola.rs/user-guide/expressions/plugins/ ) .
7
8
This is new functionality and should be preferred over ` 2. ` as this
8
9
will circumvent the GIL and will be the way we want to support extending polars.
9
10
11
+
10
12
Parallelism and optimizations are managed by the default polars runtime. That runtime will call into the plugin function.
11
13
The plugin functions are compiled separately.
12
14
@@ -15,10 +17,11 @@ Those can then have specialized expressions and don't have to worry as much for
15
17
16
18
The idea is that you define an expression in another Rust crate with a proc_macro ` polars_expr ` .
17
19
18
- That macro can have the following attributes:
20
+ The macro may have one of the following attributes:
19
21
20
22
- ` output_type ` -> to define the output type of that expression
21
23
- ` output_type_func ` -> to define a function that computes the output type based on input types.
24
+ - ` output_type_func_with_kwargs ` -> to define a function that computes the output type based on input types and keyword args.
22
25
23
26
Here is an example of a ` String ` conversion expression that converts any string to [ pig latin] ( https://en.wikipedia.org/wiki/Pig_Latin ) :
24
27
You can’t perform that action at this time.
0 commit comments