Skip to content

Commit

Permalink
update arrow
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Dec 22, 2021
1 parent 1d848c4 commit 62baefd
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion polars/polars-arrow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description = "Arrow interfaces for Polars DataFrame library"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
arrow = { package = "arrow2", git = "https://github.com/jorgecarleitao/arrow2", rev = "4bbbe62c7fb36d24d2ccdb3bf3130d97aac4c069", default-features = false }
arrow = { package = "arrow2", git = "https://github.com/jorgecarleitao/arrow2", rev = "45e72e98c8857007ca8679e68837ff0eb50f551d", default-features = false }
# arrow = { package = "arrow2", git = "https://github.com/ritchie46/arrow2", default-features = false, features = ["compute"], branch = "offset_pub" }
# arrow = { package = "arrow2", version = "0.8", default-features = false }
num = "^0.4"
Expand Down
4 changes: 2 additions & 2 deletions polars/polars-arrow/src/array/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use arrow::array::{Array, ArrayRef, BooleanArray, ListArray, PrimitiveArray, Utf8Array};
use arrow::bitmap::MutableBitmap;
use arrow::datatypes::DataType;
use arrow::types::{NativeType, NaturalDataType};
use arrow::types::NativeType;
use std::sync::Arc;

use crate::utils::CustomIterTools;
Expand Down Expand Up @@ -76,7 +76,7 @@ pub trait ListFromIter {
data_type: DataType,
) -> ListArray<i64>
where
T: NativeType + NaturalDataType,
T: NativeType,
P: IntoIterator<Item = Option<T>>,
I: IntoIterator<Item = Option<P>>,
{
Expand Down
2 changes: 1 addition & 1 deletion polars/polars-arrow/src/kernels/rolling/no_nulls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ where

let validity = create_validity(min_periods, len as usize, window_size, det_offsets_fn);
Arc::new(PrimitiveArray::from_data(
K::DATA_TYPE,
K::PRIMITIVE.into(),
out.into(),
validity.map(|b| b.into()),
))
Expand Down
2 changes: 1 addition & 1 deletion polars/polars-arrow/src/kernels/rolling/nulls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ where
.collect_trusted::<Vec<K>>();

Arc::new(PrimitiveArray::from_data(
K::DATA_TYPE,
K::PRIMITIVE.into(),
out.into(),
Some(validity.into()),
))
Expand Down
14 changes: 9 additions & 5 deletions polars/polars-arrow/src/kernels/take.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ pub unsafe fn take_primitive_unchecked<T: NativeType>(
}
});
};
let arr = PrimitiveArray::from_data(T::DATA_TYPE, values.into(), Some(validity.into()));
let arr = PrimitiveArray::from_data(T::PRIMITIVE.into(), values.into(), Some(validity.into()));

Arc::new(arr)
}
Expand All @@ -98,7 +98,11 @@ pub unsafe fn take_no_null_primitive<T: NativeType>(

let values = Buffer::from_trusted_len_iter(iter);
let validity = indices.validity().cloned();
Arc::new(PrimitiveArray::from_data(T::DATA_TYPE, values, validity))
Arc::new(PrimitiveArray::from_data(
T::PRIMITIVE.into(),
values,
validity,
))
}

/// Take kernel for single chunk without nulls and an iterator as index.
Expand All @@ -122,7 +126,7 @@ pub unsafe fn take_no_null_primitive_iter_unchecked<
.map(|idx| *array_values.get_unchecked(idx));

let values = Buffer::from_trusted_len_iter_unchecked(iter);
Arc::new(PrimitiveArray::from_data(T::DATA_TYPE, values, None))
Arc::new(PrimitiveArray::from_data(T::PRIMITIVE.into(), values, None))
}

/// Take kernel for a single chunk with null values and an iterator as index.
Expand Down Expand Up @@ -169,7 +173,7 @@ pub unsafe fn take_no_null_primitive_opt_iter_unchecked<
let iter = indices
.into_iter()
.map(|opt_idx| opt_idx.map(|idx| *array_values.get_unchecked(idx)));
let arr = PrimitiveArray::from_trusted_len_iter_unchecked(iter).to(T::DATA_TYPE);
let arr = PrimitiveArray::from_trusted_len_iter_unchecked(iter).to(T::PRIMITIVE.into());

Arc::new(arr)
}
Expand Down Expand Up @@ -200,7 +204,7 @@ pub unsafe fn take_primitive_opt_iter_unchecked<
}
})
});
let arr = PrimitiveArray::from_trusted_len_iter_unchecked(iter).to(T::DATA_TYPE);
let arr = PrimitiveArray::from_trusted_len_iter_unchecked(iter).to(T::PRIMITIVE.into());

Arc::new(arr)
}
Expand Down
2 changes: 1 addition & 1 deletion polars/polars-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ unsafe_unwrap = "^0.1.0"
package = "arrow2"
git = "https://github.com/jorgecarleitao/arrow2"
# git = "https://github.com/ritchie46/arrow2"
rev = "4bbbe62c7fb36d24d2ccdb3bf3130d97aac4c069"
rev = "45e72e98c8857007ca8679e68837ff0eb50f551d"
# branch = "offset_pub"
# version = "0.8"
default-features = false
Expand Down
2 changes: 1 addition & 1 deletion polars/polars-io/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ private = []
[dependencies]
ahash = "0.7"
anyhow = "1.0"
arrow = { package = "arrow2", git = "https://github.com/jorgecarleitao/arrow2", rev = "4bbbe62c7fb36d24d2ccdb3bf3130d97aac4c069", default-features = false }
arrow = { package = "arrow2", git = "https://github.com/jorgecarleitao/arrow2", rev = "45e72e98c8857007ca8679e68837ff0eb50f551d", default-features = false }
# arrow = { package = "arrow2", git = "https://github.com/ritchie46/arrow2", default-features = false, features = ["compute"], branch = "offset_pub" }
# arrow = { package = "arrow2", version = "0.8", default-features = false }
csv-core = { version = "0.1.10", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion py-polars/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 62baefd

Please sign in to comment.