Skip to content

Commit

Permalink
chore: update to rustct 2023-05-07 (#8713)
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 authored May 7, 2023
1 parent c982319 commit ac76c9a
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/deploy_manylinux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ls -la
rm py-polars/README.md
cp README.md py-polars/README.md
cd py-polars
rustup override set nightly-2023-04-11
rustup override set nightly-2023-05-07
export RUSTFLAGS='-C target-feature=+fxsr,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt,+avx,+fma'

# first the default release
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-python-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- py-*

env:
RUST_TOOLCHAIN: nightly-2023-04-11
RUST_TOOLCHAIN: nightly-2023-05-07
PYTHON_VERSION: '3.7'
MATURIN_VERSION: '0.14.10'
MATURIN_PASSWORD: ${{ secrets.PYPI_PASS }}
Expand Down
2 changes: 1 addition & 1 deletion polars/polars-arrow/src/kernels/list_bytes_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ unsafe fn bytes_iter<'a, T: NativeType>(
start = end;

let data = out.as_ptr() as *const u8;
let out = std::slice::from_raw_parts(data, std::mem::size_of::<T>() * out.len());
let out = std::slice::from_raw_parts(data, std::mem::size_of_val(out));
match validity {
None => Some(out),
Some(validity) => {
Expand Down
3 changes: 2 additions & 1 deletion polars/polars-core/src/series/implementations/decimal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ impl SeriesTrait for SeriesWrap<DecimalChunked> {

fn append(&mut self, other: &Series) -> PolarsResult<()> {
polars_ensure!(self.0.dtype() == other.dtype(), append);
self.0.append(other.as_ref().as_ref());
let other = other.decimal()?;
self.0.append(&other.0);
Ok(())
}

Expand Down
28 changes: 17 additions & 11 deletions polars/polars-core/src/series/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1014,17 +1014,23 @@ where
T: 'static + PolarsDataType,
{
fn as_ref(&self) -> &ChunkedArray<T> {
if &T::get_dtype() == self.dtype() ||
// needed because we want to get ref of List no matter what the inner type is.
(matches!(T::get_dtype(), DataType::List(_)) && matches!(self.dtype(), DataType::List(_)))
{
unsafe { &*(self as *const dyn SeriesTrait as *const ChunkedArray<T>) }
} else {
panic!(
"implementation error, cannot get ref {:?} from {:?}",
T::get_dtype(),
self.dtype()
)
match T::get_dtype() {
#[cfg(feature = "dtype-decimal")]
DataType::Decimal(None, None) => panic!("impl error"),
_ => {
if &T::get_dtype() == self.dtype() ||
// needed because we want to get ref of List no matter what the inner type is.
(matches!(T::get_dtype(), DataType::List(_)) && matches!(self.dtype(), DataType::List(_)))
{
unsafe { &*(self as *const dyn SeriesTrait as *const ChunkedArray<T>) }
} else {
panic!(
"implementation error, cannot get ref {:?} from {:?}",
T::get_dtype(),
self.dtype()
);
}
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion polars/polars-sql/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl SQLContext {
/// # }
///```
pub fn execute(&mut self, query: &str) -> PolarsResult<LazyFrame> {
let ast = Parser::parse_sql(&GenericDialect::default(), query).map_err(to_compute_err)?;
let ast = Parser::parse_sql(&GenericDialect, query).map_err(to_compute_err)?;
polars_ensure!(ast.len() == 1, ComputeError: "One and only one statement at a time please");
let res = self.execute_statement(ast.get(0).unwrap());
// every execution should clear the cte map
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[toolchain]
channel = "nightly-2023-04-11"
channel = "nightly-2023-05-07"

0 comments on commit ac76c9a

Please sign in to comment.