Skip to content

Commit

Permalink
checkpointing with a few todos to fix remaining compile errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-J-Ward committed Jun 13, 2024
1 parent 5f08588 commit 04c5887
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/common/data_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ impl DataTypeMap {
pub fn map_from_scalar_to_arrow(scalar_val: &ScalarValue) -> Result<DataType, PyErr> {
match scalar_val {
ScalarValue::Boolean(_) => Ok(DataType::Boolean),
ScalarValue::Float16(_) => Ok(DataType::Float16),
ScalarValue::Float32(_) => Ok(DataType::Float32),
ScalarValue::Float64(_) => Ok(DataType::Float64),
ScalarValue::Decimal128(_, precision, scale) => {
Expand Down
11 changes: 8 additions & 3 deletions src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use datafusion::scalar::ScalarValue;
use datafusion_expr::{
col,
expr::{AggregateFunction, InList, InSubquery, ScalarFunction, Sort, WindowFunction},
lit, Between, BinaryExpr, Case, Cast, Expr, GetFieldAccess, Like, Operator, TryCast,
lit, Between, BinaryExpr, Case, Cast, Expr, Like, Operator, TryCast,
};

use crate::common::data_type::{DataTypeMap, RexType};
Expand Down Expand Up @@ -307,6 +307,11 @@ impl PyExpr {
),
)),
ScalarValue::Boolean(v) => Ok(v.into_py(py)),
ScalarValue::Float16(_) => Err(py_datafusion_err(
datafusion_common::DataFusionError::NotImplemented(
"ScalarValue::Float16".to_string(),
),
)),
ScalarValue::Float32(v) => Ok(v.into_py(py)),
ScalarValue::Float64(v) => Ok(v.into_py(py)),
ScalarValue::Decimal128(v, _, _) => Ok(v.into_py(py)),
Expand Down Expand Up @@ -348,8 +353,8 @@ impl PyExpr {
ScalarValue::TimestampMicrosecond(v, _) => Ok(v.into_py(py)),
ScalarValue::TimestampNanosecond(v, _) => Ok(v.into_py(py)),
ScalarValue::IntervalYearMonth(v) => Ok(v.into_py(py)),
ScalarValue::IntervalDayTime(v) => Ok(v.into_py(py)),
ScalarValue::IntervalMonthDayNano(v) => Ok(v.into_py(py)),
ScalarValue::IntervalDayTime(v) => todo!(), // Ok(v.clone().into_py(py)),
ScalarValue::IntervalMonthDayNano(v) => todo!(), // Ok(v.into_py(py)),
ScalarValue::DurationSecond(v) => Ok(v.into_py(py)),
ScalarValue::DurationMicrosecond(v) => Ok(v.into_py(py)),
ScalarValue::DurationNanosecond(v) => Ok(v.into_py(py)),
Expand Down
4 changes: 1 addition & 3 deletions src/expr/literal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,7 @@ impl PyLiteral {

pub fn value_interval_day_time(&self) -> PyResult<Option<(i32, i32)>> {
match &self.value {
ScalarValue::IntervalDayTime(Some(iv)) => {
Ok(Some((iv.days, iv.milliseconds)))
}
ScalarValue::IntervalDayTime(Some(iv)) => Ok(Some((iv.days, iv.milliseconds))),
ScalarValue::IntervalDayTime(None) => Ok(None),
other => Err(unexpected_literal_value(other)),
}
Expand Down

0 comments on commit 04c5887

Please sign in to comment.