Skip to content

Commit

Permalink
Remove unsendable from all Rust pyclass types. (#348)
Browse files Browse the repository at this point in the history
  • Loading branch information
kylebrooks-8451 authored Apr 27, 2023
1 parent af1a8eb commit a1e2b8b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 36 deletions.
6 changes: 3 additions & 3 deletions src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ use pyo3::types::PyTuple;
use tokio::task::JoinHandle;

/// Configuration options for a SessionContext
#[pyclass(name = "SessionConfig", module = "datafusion", subclass, unsendable)]
#[pyclass(name = "SessionConfig", module = "datafusion", subclass)]
#[derive(Clone, Default)]
pub(crate) struct PySessionConfig {
pub(crate) config: SessionConfig,
Expand Down Expand Up @@ -148,7 +148,7 @@ impl PySessionConfig {
}

/// Runtime options for a SessionContext
#[pyclass(name = "RuntimeConfig", module = "datafusion", subclass, unsendable)]
#[pyclass(name = "RuntimeConfig", module = "datafusion", subclass)]
#[derive(Clone)]
pub(crate) struct PyRuntimeConfig {
pub(crate) config: RuntimeConfig,
Expand Down Expand Up @@ -210,7 +210,7 @@ impl PyRuntimeConfig {
/// `PySessionContext` is able to plan and execute DataFusion plans.
/// It has a powerful optimizer, a physical planner for local execution, and a
/// multi-threaded execution engine to perform the execution.
#[pyclass(name = "SessionContext", module = "datafusion", subclass, unsendable)]
#[pyclass(name = "SessionContext", module = "datafusion", subclass)]
#[derive(Clone)]
pub(crate) struct PySessionContext {
pub(crate) ctx: SessionContext,
Expand Down
23 changes: 4 additions & 19 deletions src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,7 @@ pub enum StorageContexts {
LocalFileSystem(PyLocalFileSystemContext),
}

#[pyclass(
name = "LocalFileSystem",
module = "datafusion.store",
subclass,
unsendable
)]
#[pyclass(name = "LocalFileSystem", module = "datafusion.store", subclass)]
#[derive(Debug, Clone)]
pub struct PyLocalFileSystemContext {
pub inner: Arc<LocalFileSystem>,
Expand All @@ -63,12 +58,7 @@ impl PyLocalFileSystemContext {
}
}

#[pyclass(
name = "MicrosoftAzure",
module = "datafusion.store",
subclass,
unsendable
)]
#[pyclass(name = "MicrosoftAzure", module = "datafusion.store", subclass)]
#[derive(Debug, Clone)]
pub struct PyMicrosoftAzureContext {
pub inner: Arc<MicrosoftAzure>,
Expand Down Expand Up @@ -140,12 +130,7 @@ impl PyMicrosoftAzureContext {
}
}

#[pyclass(
name = "GoogleCloud",
module = "datafusion.store",
subclass,
unsendable
)]
#[pyclass(name = "GoogleCloud", module = "datafusion.store", subclass)]
#[derive(Debug, Clone)]
pub struct PyGoogleCloudContext {
pub inner: Arc<GoogleCloudStorage>,
Expand Down Expand Up @@ -175,7 +160,7 @@ impl PyGoogleCloudContext {
}
}

#[pyclass(name = "AmazonS3", module = "datafusion.store", subclass, unsendable)]
#[pyclass(name = "AmazonS3", module = "datafusion.store", subclass)]
#[derive(Debug, Clone)]
pub struct PyAmazonS3Context {
pub inner: Arc<AmazonS3>,
Expand Down
18 changes: 4 additions & 14 deletions src/substrait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use datafusion_substrait::serializer;
use datafusion_substrait::substrait::proto::Plan;
use prost::Message;

#[pyclass(name = "plan", module = "datafusion.substrait", subclass, unsendable)]
#[pyclass(name = "plan", module = "datafusion.substrait", subclass)]
#[derive(Debug, Clone)]
pub(crate) struct PyPlan {
pub(crate) plan: Plan,
Expand Down Expand Up @@ -59,7 +59,7 @@ impl From<Plan> for PyPlan {
/// A PySubstraitSerializer is a representation of a Serializer that is capable of both serializing
/// a `LogicalPlan` instance to Substrait Protobuf bytes and also deserialize Substrait Protobuf bytes
/// to a valid `LogicalPlan` instance.
#[pyclass(name = "serde", module = "datafusion.substrait", subclass, unsendable)]
#[pyclass(name = "serde", module = "datafusion.substrait", subclass)]
#[derive(Debug, Clone)]
pub(crate) struct PySubstraitSerializer;

Expand Down Expand Up @@ -105,12 +105,7 @@ impl PySubstraitSerializer {
}
}

#[pyclass(
name = "producer",
module = "datafusion.substrait",
subclass,
unsendable
)]
#[pyclass(name = "producer", module = "datafusion.substrait", subclass)]
#[derive(Debug, Clone)]
pub(crate) struct PySubstraitProducer;

Expand All @@ -126,12 +121,7 @@ impl PySubstraitProducer {
}
}

#[pyclass(
name = "consumer",
module = "datafusion.substrait",
subclass,
unsendable
)]
#[pyclass(name = "consumer", module = "datafusion.substrait", subclass)]
#[derive(Debug, Clone)]
pub(crate) struct PySubstraitConsumer;

Expand Down

0 comments on commit a1e2b8b

Please sign in to comment.