Skip to content

Commit

Permalink
feat!(wasm): remove feature flag (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjrusso8 authored Nov 1, 2024
1 parent bb46632 commit 188fb52
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 210 deletions.
135 changes: 12 additions & 123 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ rust-version = "1.81"

[workspace.dependencies]
tonic = { version ="0.11", default-features = false }
tonic-web-wasm-client = { version = "0.6" }

tokio = { version = "1.40", default-features = false, features = ["macros"] }
tower = { version = "0.5" }
Expand All @@ -39,8 +38,6 @@ url = { version = "2.5" }

chrono = { version = "0.4.38" }

getrandom = { version = "0.2" }

datafusion = { version = "42.0", default-features = false }
polars = { version = "0.43", default-features = false }
polars-arrow = { version = "0.43", default-features = false, features = ["arrow_rs"] }
11 changes: 0 additions & 11 deletions crates/connect/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ include = [

[dependencies]
tonic = { workspace = true, default-features = false, optional = true }
tonic-web-wasm-client = { workspace = true, optional = true }

tower = { workspace = true }
tokio = { workspace = true, optional = true }
Expand All @@ -42,8 +41,6 @@ url = { workspace = true }

chrono = { workspace = true }

getrandom = { workspace = true, optional = true }

datafusion = { workspace = true, optional = true }

polars = { workspace = true, optional = true }
Expand Down Expand Up @@ -72,14 +69,6 @@ tls = [
"tonic/tls-roots"
]

wasm = [
"tonic-web-wasm-client",
"tonic/codegen",
"tonic/prost",
"getrandom/js",
"tokio"
]

datafusion = [
"dep:datafusion"
]
Expand Down
7 changes: 1 addition & 6 deletions crates/connect/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,11 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
file_paths.push(entry.to_str().unwrap().to_string());
}

#[cfg(feature = "wasm")]
let transport = false;
#[cfg(not(feature = "wasm"))]
let transport = true;

tonic_build::configure()
.protoc_arg("--experimental_allow_proto3_optional")
.build_server(false)
.build_client(true)
.build_transport(transport)
.build_transport(true)
.compile(file_paths.as_ref(), &["./protobuf/spark-3.5/"])?;

Ok(())
Expand Down
17 changes: 0 additions & 17 deletions crates/connect/src/conf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,9 @@ use crate::spark;
use crate::client::SparkClient;
use crate::errors::SparkError;

#[cfg(feature = "wasm")]
use tonic_web_wasm_client::Client;

/// User-facing configuration API, accessible through SparkSession.conf.
pub struct RunTimeConfig {
#[cfg(not(feature = "wasm"))]
pub(crate) client: SparkClient,

#[cfg(feature = "wasm")]
pub(crate) client: SparkConnectClient<InterceptedService<Client, MetadataInterceptor>>,
}

/// User-facing configuration API, accessible through SparkSession.conf.
Expand All @@ -31,22 +24,12 @@ pub struct RunTimeConfig {
/// .await?;
/// ```
impl RunTimeConfig {
#[cfg(not(feature = "wasm"))]
pub fn new(client: &SparkClient) -> RunTimeConfig {
RunTimeConfig {
client: client.clone(),
}
}

#[cfg(feature = "wasm")]
pub fn new(
client: &SparkConnectClient<InterceptedService<Client, MetadataInterceptor>>,
) -> RunTimeConfig {
RunTimeConfig {
client: client.clone(),
}
}

pub(crate) async fn set_configs(
&mut self,
map: &HashMap<String, String>,
Expand Down
Loading

0 comments on commit 188fb52

Please sign in to comment.