Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add forgotten files #63

Merged
merged 1 commit into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions pyo3-polars-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ fn quote_get_kwargs() -> proc_macro2::TokenStream {
let kwargs = match pyo3_polars::derive::_parse_kwargs(kwargs) {
Ok(value) => value,
Err(err) => {
let err = polars_err!(InvalidOperation: "could not parse kwargs: '{}'\n\nCheck: registration of kwargs in the plugin.", err);
pyo3_polars::derive::_update_last_error(err);
return;
}
Expand Down Expand Up @@ -220,7 +221,7 @@ fn create_field_function(
)
} else {
quote!(
let result = #dtype_fn_name(&inputs);
let result = #dtype_fn_name(&inputs);
)
};

Expand All @@ -240,7 +241,7 @@ fn create_field_function(

match result {
Ok(out) => {
let out = polars_core::export::arrow::ffi::export_field_to_c(&out.to_arrow());
let out = polars_core::export::arrow::ffi::export_field_to_c(&out.to_arrow(true));
*return_value = out;
},
Err(err) => {
Expand Down Expand Up @@ -277,7 +278,7 @@ fn create_field_function_from_with_dtype(
let mapper = polars_plan::dsl::FieldsMapper::new(&inputs);
let dtype = polars_core::datatypes::DataType::#dtype;
let out = mapper.with_dtype(dtype).unwrap();
let out = polars_core::export::arrow::ffi::export_field_to_c(&out.to_arrow());
let out = polars_core::export::arrow::ffi::export_field_to_c(&out.to_arrow(true));
*return_value = out;
}
)
Expand Down
4 changes: 2 additions & 2 deletions pyo3-polars/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ impl<'a> FromPyObject<'a> for PySeries {
let name = ob.getattr("name")?;
let name = name.str()?.to_str()?;

let arr = ob.call_method0("to_arrow")?;
let arr = ob.call_method1("to_arrow", (true,))?;
let arr = ffi::to_rust::array_to_rust(arr)?;
Ok(PySeries(
Series::try_from((name, arr)).map_err(PyPolarsErr::from)?,
Expand Down Expand Up @@ -162,7 +162,7 @@ impl IntoPy<PyObject> for PySeries {
fn into_py(self, py: Python<'_>) -> PyObject {
let s = self.0.rechunk();
let name = s.name();
let arr = s.to_arrow(0);
let arr = s.to_arrow(0, true);
let pyarrow = py.import("pyarrow").expect("pyarrow not installed");
let polars = py.import("polars").expect("polars not installed");

Expand Down
Loading