Skip to content

Commit 2c48b49

Browse files
committed
document output_type_func_with_kwargs in README
1 parent c04d471 commit 2c48b49

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
<img src="https://img.shields.io/crates/v/pyo3-polars.svg"/>
55
</a>
66

7+
Documentation for this functionality may also be found in the [Polars User Guide](https://docs.pola.rs/user-guide/expressions/plugins/).
78
This is new functionality and should be preferred over `2.` as this
89
will circumvent the GIL and will be the way we want to support extending polars.
910

11+
1012
Parallelism and optimizations are managed by the default polars runtime. That runtime will call into the plugin function.
1113
The plugin functions are compiled separately.
1214

@@ -15,10 +17,11 @@ Those can then have specialized expressions and don't have to worry as much for
1517

1618
The idea is that you define an expression in another Rust crate with a proc_macro `polars_expr`.
1719

18-
That macro can have the following attributes:
20+
The macro may have one of the following attributes:
1921

2022
- `output_type` -> to define the output type of that expression
2123
- `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.
2225

2326
Here is an example of a `String` conversion expression that converts any string to [pig latin](https://en.wikipedia.org/wiki/Pig_Latin):
2427

0 commit comments

Comments
 (0)