update polar to 0.25 (#6988)

This commit is contained in:
WindSoilder
2022-11-10 06:07:38 +08:00
committed by GitHub
parent 2c238aea6a
commit c259ef41bd
12 changed files with 327 additions and 228 deletions

View File

@@ -199,7 +199,7 @@ fn command(
_ => None,
};
let std = match col.std_as_series().get(0) {
let std = match col.std_as_series(0).get(0) {
AnyValue::Float64(v) => Some(v),
_ => None,
};

View File

@@ -213,6 +213,7 @@ fn from_ipc(
cache: true,
rechunk: false,
row_count: None,
memmap: true,
};
let df: NuLazyFrame = LazyFrame::scan_ipc(file, args)

View File

@@ -1,5 +1,5 @@
use crate::dataframe::eager::sql_expr::parse_sql_expr;
use polars::error::PolarsError;
use polars::error::{ErrString, PolarsError};
use polars::prelude::{col, DataFrame, DataType, IntoLazy, LazyFrame};
use sqlparser::ast::{
Expr as SqlExpr, Select, SelectItem, SetExpr, Statement, TableFactor, Value as SQLValue,
@@ -30,7 +30,7 @@ impl SQLContext {
// Determine involved dataframe
// Implicit join require some more work in query parsers, Explicit join are preferred for now.
let tbl = select_stmt.from.get(0).ok_or_else(|| {
PolarsError::NotFound("No table found in select statement".to_string())
PolarsError::NotFound(ErrString::from("No table found in select statement"))
})?;
let mut alias_map = HashMap::new();
let tbl_name = match &tbl.relation {
@@ -39,7 +39,7 @@ impl SQLContext {
.0
.get(0)
.ok_or_else(|| {
PolarsError::NotFound("No table found in select statement".to_string())
PolarsError::NotFound(ErrString::from("No table found in select statement"))
})?
.value
.to_string();
@@ -181,7 +181,7 @@ impl SQLContext {
} else {
let ast = ast
.get(0)
.ok_or_else(|| PolarsError::NotFound("No statement found".to_string()))?;
.ok_or_else(|| PolarsError::NotFound(ErrString::from("No statement found")))?;
Ok(match ast {
Statement::Query(query) => {
let rs = match &*query.body {

View File

@@ -1,5 +1,5 @@
use polars::error::PolarsError;
use polars::prelude::{col, lit, DataType, Expr, LiteralValue, Result, TimeUnit};
use polars::prelude::{col, lit, DataType, Expr, LiteralValue, PolarsResult as Result, TimeUnit};
use sqlparser::ast::{
BinaryOperator as SQLBinaryOperator, DataType as SQLDataType, Expr as SqlExpr,