Skip to content

Commit

Permalink
update datafusion to 5.1.0 for python binding
Browse files Browse the repository at this point in the history
  • Loading branch information
houqp committed Sep 4, 2021
1 parent 7932cb9 commit 8fbaa3a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
5 changes: 3 additions & 2 deletions python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# under the License.

[package]
name = "datafusion"
name = "datafusion-python"
version = "0.3.0"
homepage = "https://github.com/apache/arrow"
repository = "https://github.com/apache/arrow"
Expand All @@ -31,7 +31,8 @@ libc = "0.2"
tokio = { version = "1.0", features = ["macros", "rt", "rt-multi-thread", "sync"] }
rand = "0.7"
pyo3 = { version = "0.14.1", features = ["extension-module", "abi3", "abi3-py36"] }
datafusion = { git = "https://github.com/apache/arrow-datafusion.git", rev = "4d61196dee8526998aee7e7bb10ea88422e5f9e1" }
datafusion = { path = "../datafusion", version = "5.1.0" }
proc-macro2 = { version = "=1.0.28" }

[lib]
name = "datafusion"
Expand Down
10 changes: 7 additions & 3 deletions python/src/dataframe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,13 @@ impl DataFrame {
Ok(pretty::print_batches(&batches).unwrap())
}


/// Returns the join of two DataFrames `on`.
fn join(&self, right: &DataFrame, on: Vec<&str>, how: &str) -> PyResult<Self> {
fn join(
&self,
right: &DataFrame,
join_keys: (Vec<&str>, Vec<&str>),
how: &str,
) -> PyResult<Self> {
let builder = LogicalPlanBuilder::from(self.plan.clone());

let join_type = match how {
Expand All @@ -182,7 +186,7 @@ impl DataFrame {
}
};

let builder = errors::wrap(builder.join(&right.plan, join_type, on.clone(), on))?;
let builder = errors::wrap(builder.join(&right.plan, join_type, join_keys))?;

let plan = errors::wrap(builder.build())?;

Expand Down
2 changes: 1 addition & 1 deletion python/tests/test_df.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def test_join():
)
df1 = ctx.create_dataframe([[batch]])

df = df.join(df1, on="a", how="inner")
df = df.join(df1, on=("a", "a"), how="inner")
df = df.sort([f.col("a").sort(ascending=True)])
table = pa.Table.from_batches(df.collect())

Expand Down

0 comments on commit 8fbaa3a

Please sign in to comment.