From 1323b3235790a41d2aa6c07e2c115f8ee42070b8 Mon Sep 17 00:00:00 2001 From: Shivam Kapoor <4599890+iamsmkr@users.noreply.github.com> Date: Thu, 20 Jun 2024 12:46:56 +0100 Subject: [PATCH] add deps --- raphtory/Cargo.toml | 10 ++++++---- raphtory/src/core/utils/errors.rs | 2 ++ raphtory/src/python/graph/io/parquet_loaders.rs | 3 +-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/raphtory/Cargo.toml b/raphtory/Cargo.toml index 3e0c488ae0..0773b4ee6f 100644 --- a/raphtory/Cargo.toml +++ b/raphtory/Cargo.toml @@ -104,12 +104,11 @@ io = [ # Enables generating the pyo3 python bindings python = [ "io", + "arrow", "dep:pyo3", "dep:num", "dep:display-error-chain", - "dep:polars-arrow", "polars-arrow?/compute", - "dep:polars-parquet", "dep:kdam", "dep:rpds", ] @@ -119,10 +118,9 @@ search = ["dep:tantivy"] vectors = ["dep:futures-util", "dep:async-trait", "dep:async-openai"] # storage storage = [ + "arrow", "pometry-storage", - "dep:polars-arrow", "dep:polars-utils", - "dep:polars-parquet", "dep:memmap2", "dep:ahash", "dep:tempfile", @@ -133,3 +131,7 @@ storage = [ "polars-arrow?/arrow_rs", "polars-parquet?/compression", ] +arrow = [ + "dep:polars-arrow", + "dep:polars-parquet", +] diff --git a/raphtory/src/core/utils/errors.rs b/raphtory/src/core/utils/errors.rs index c17d619f0b..7b840883f5 100644 --- a/raphtory/src/core/utils/errors.rs +++ b/raphtory/src/core/utils/errors.rs @@ -1,4 +1,5 @@ use crate::core::{utils::time::error::ParseTimeError, ArcStr, Prop, PropType}; +#[cfg(feature = "arrow")] use polars_arrow::legacy::error; #[cfg(feature = "search")] use tantivy; @@ -7,6 +8,7 @@ use tantivy::query::QueryParserError; #[derive(thiserror::Error, Debug)] pub enum GraphError { + #[cfg(feature = "arrow")] #[error("Arrow error: {0}")] Arrow(#[from] error::PolarsError), #[error("Graph error occurred")] diff --git a/raphtory/src/python/graph/io/parquet_loaders.rs b/raphtory/src/python/graph/io/parquet_loaders.rs index 61fd4d2d18..0877aa47b7 100644 --- a/raphtory/src/python/graph/io/parquet_loaders.rs +++ b/raphtory/src/python/graph/io/parquet_loaders.rs @@ -1,6 +1,6 @@ use crate::{ core::{entities::graph::tgraph::InternalGraph, utils::errors::GraphError, Prop}, - python::graph::io::{dataframe::*, df_loaders::*, panda_loaders::process_pandas_py_df}, + python::graph::io::{dataframe::*, df_loaders::*}, }; use itertools::Itertools; use polars_arrow::{ @@ -13,7 +13,6 @@ use polars_parquet::{ read, read::{read_metadata, FileMetaData, FileReader}, }; -use pyo3::{types::IntoPyDict, PyAny, PyErr, Python}; use std::{collections::HashMap, path::Path}; pub fn load_nodes_from_parquet(