From 14b234c300779ef4e7d0612bbfe9aaac03d8502e Mon Sep 17 00:00:00 2001 From: eitsupi <50911393+eitsupi@users.noreply.github.com> Date: Sun, 29 Dec 2024 16:10:54 +0000 Subject: [PATCH] fix: fix feature flag for wasm --- src/Makevars.in | 1 - src/rust/src/conversion/mod.rs | 2 ++ src/rust/src/expr/string.rs | 2 ++ src/rust/src/expr/struct.rs | 2 ++ src/rust/src/lazyframe/general.rs | 4 ++++ 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Makevars.in b/src/Makevars.in index b5883a95..dfa0ead0 100644 --- a/src/Makevars.in +++ b/src/Makevars.in @@ -27,7 +27,6 @@ $(STATLIB): cargo build $(CARGO_BUILD_ARGS); \ else \ sed -E -i \ - -e 's/^\s*"json",$$/"serde_json",/' \ -e "/^\s*\"($(WASM_INCOMPATIBLE_FEATURES))\",$$/d" \ ./rust/Cargo.toml && \ export CC="$(CC)" && \ diff --git a/src/rust/src/conversion/mod.rs b/src/rust/src/conversion/mod.rs index 7e4c2d01..0d6a0ab7 100644 --- a/src/rust/src/conversion/mod.rs +++ b/src/rust/src/conversion/mod.rs @@ -665,6 +665,8 @@ pub(crate) fn parse_cloud_options( Ok(out) } +// TODO: Refactor with adding `parquet` feature as like Python Polars +#[cfg(not(target_arch = "wasm32"))] impl TryFrom<&str> for Wrap { type Error = String; diff --git a/src/rust/src/expr/string.rs b/src/rust/src/expr/string.rs index b9da2644..6645f280 100644 --- a/src/rust/src/expr/string.rs +++ b/src/rust/src/expr/string.rs @@ -111,6 +111,8 @@ impl PlRExpr { .into()) } + // TODO: Refactor with adding `extract_jsonpath` feature as like Python Polars + #[cfg(not(target_arch = "wasm32"))] fn str_json_path_match(&self, pat: &PlRExpr) -> Result { Ok(self .inner diff --git a/src/rust/src/expr/struct.rs b/src/rust/src/expr/struct.rs index 096c316e..e603ad45 100644 --- a/src/rust/src/expr/struct.rs +++ b/src/rust/src/expr/struct.rs @@ -26,6 +26,8 @@ impl PlRExpr { .into()) } + // TODO: Refactor with adding `json` feature as like Python Polars + #[cfg(not(target_arch = "wasm32"))] fn struct_json_encode(&self) -> Result { Ok(self.inner.clone().struct_().json_encode().into()) } diff --git a/src/rust/src/lazyframe/general.rs b/src/rust/src/lazyframe/general.rs index d5eeada4..1389d17f 100644 --- a/src/rust/src/lazyframe/general.rs +++ b/src/rust/src/lazyframe/general.rs @@ -460,6 +460,8 @@ impl PlRLazyFrame { Ok(r.finish().map_err(RPolarsErr::from)?.into()) } + // TODO: Refactor with adding `parquet` feature as like Python Polars + #[cfg(not(target_arch = "wasm32"))] fn new_from_parquet( source: StringSexp, cache: bool, @@ -565,6 +567,8 @@ impl PlRLazyFrame { Ok(lf.into()) } + // TODO: Refactor with adding `json` feature as like Python Polars + #[cfg(not(target_arch = "wasm32"))] fn new_from_ndjson( source: StringSexp, low_memory: bool,