From 037a84fb0fbfe92d8a14fc339e70dbca737e7668 Mon Sep 17 00:00:00 2001 From: Sammy Sidhu Date: Tue, 12 Sep 2023 15:06:26 -0600 Subject: [PATCH] add binding for reccursive iter to python --- src/daft-core/src/array/ops/concat_agg.rs | 6 +++--- src/daft-io/src/object_io.rs | 1 - src/daft-io/src/python.rs | 8 ++------ src/daft-plan/src/test/mod.rs | 4 ++-- 4 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/daft-core/src/array/ops/concat_agg.rs b/src/daft-core/src/array/ops/concat_agg.rs index 97b588fd0b..ec92b9ecdb 100644 --- a/src/daft-core/src/array/ops/concat_agg.rs +++ b/src/daft-core/src/array/ops/concat_agg.rs @@ -165,7 +165,7 @@ mod test { Field::new("foo", DataType::List(Box::new(DataType::Int64))), Int64Array::from(( "item", - Box::new(arrow2::array::Int64Array::from_iter(vec![].iter())), + Box::new(arrow2::array::Int64Array::from_iter([].iter())), )) .into_series(), arrow2::offset::OffsetsBuffer::::try_from(vec![0, 0, 0, 0])?, @@ -190,7 +190,7 @@ mod test { Int64Array::from(( "item", Box::new(arrow2::array::Int64Array::from_iter( - vec![Some(0), Some(1), Some(1), Some(2), None, None, Some(10000)].iter(), + [Some(0), Some(1), Some(1), Some(2), None, None, Some(10000)].iter(), )), )) .into_series(), @@ -225,7 +225,7 @@ mod test { Int64Array::from(( "item", Box::new(arrow2::array::Int64Array::from_iter( - vec![ + [ Some(0), Some(0), Some(0), diff --git a/src/daft-io/src/object_io.rs b/src/daft-io/src/object_io.rs index d74d8a3541..a3e5dbdd74 100644 --- a/src/daft-io/src/object_io.rs +++ b/src/daft-io/src/object_io.rs @@ -7,7 +7,6 @@ use futures::stream::{BoxStream, Stream}; use futures::StreamExt; use tokio::sync::mpsc::Sender; use tokio::sync::OwnedSemaphorePermit; -use tokio::sync::Semaphore; use crate::local::{collect_file, LocalFile}; diff --git a/src/daft-io/src/python.rs b/src/daft-io/src/python.rs index 808836e6b2..22d6720cd3 100644 --- a/src/daft-io/src/python.rs +++ b/src/daft-io/src/python.rs @@ -2,13 +2,9 @@ pub use common_io_config::python::{AzureConfig, GCSConfig, IOConfig}; pub use py::register_modules; mod py { - use crate::{ - get_io_client, get_runtime, - object_io::{recursive_iter, LSResult}, - parse_url, - }; + use crate::{get_io_client, get_runtime, object_io::recursive_iter, parse_url}; use common_error::DaftResult; - use futures::{StreamExt, TryStreamExt}; + use futures::TryStreamExt; use pyo3::{ prelude::*, types::{PyDict, PyList}, diff --git a/src/daft-plan/src/test/mod.rs b/src/daft-plan/src/test/mod.rs index c08c12008c..1b7406faaf 100644 --- a/src/daft-plan/src/test/mod.rs +++ b/src/daft-plan/src/test/mod.rs @@ -12,7 +12,7 @@ use crate::{ pub fn dummy_scan_node(fields: Vec) -> LogicalPlanBuilder { let schema = Arc::new(Schema::new(fields).unwrap()); LogicalPlanBuilder::table_scan( - FileInfos::new_internal(vec!["/foo".to_string()], vec![None], vec![None]).into(), + FileInfos::new_internal(vec!["/foo".to_string()], vec![None], vec![None]), schema, FileFormatConfig::Json(JsonSourceConfig {}).into(), StorageConfig::Native(NativeStorageConfig::new_internal(None).into()).into(), @@ -24,7 +24,7 @@ pub fn dummy_scan_node(fields: Vec) -> LogicalPlanBuilder { pub fn dummy_scan_node_with_limit(fields: Vec, limit: Option) -> LogicalPlanBuilder { let schema = Arc::new(Schema::new(fields).unwrap()); LogicalPlanBuilder::table_scan_with_limit( - FileInfos::new_internal(vec!["/foo".to_string()], vec![None], vec![None]).into(), + FileInfos::new_internal(vec!["/foo".to_string()], vec![None], vec![None]), schema, FileFormatConfig::Json(JsonSourceConfig {}).into(), StorageConfig::Native(NativeStorageConfig::new_internal(None).into()).into(),