You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/06/04 15:25:30 UTC

[GitHub] [arrow-datafusion] Dandandan opened a new pull request #503: Implement missing join types for Python dataframe

Dandandan opened a new pull request #503:
URL: https://github.com/apache/arrow-datafusion/pull/503


   # Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   Closes #495
   
    # Rationale for this change
   <!--
    Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.  
   -->
   
   More complete functionality for joins in Python
   
   # What changes are included in this PR?
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   # Are there any user-facing changes?
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!--
   If there are any breaking changes to public APIs, please add the `api change` label.
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] Dandandan merged pull request #503: Implement missing join types for Python dataframe

Posted by GitBox <gi...@apache.org>.
Dandandan merged pull request #503:
URL: https://github.com/apache/arrow-datafusion/pull/503


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] Dandandan commented on a change in pull request #503: Implement missing join types for Python dataframe

Posted by GitBox <gi...@apache.org>.
Dandandan commented on a change in pull request #503:
URL: https://github.com/apache/arrow-datafusion/pull/503#discussion_r645672597



##########
File path: python/Cargo.toml
##########
@@ -31,7 +31,7 @@ libc = "0.2"
 tokio = { version = "1.0", features = ["macros", "rt", "rt-multi-thread", "sync"] }
 rand = "0.7"
 pyo3 = { version = "0.13.2", features = ["extension-module"] }
-datafusion = { git = "https://github.com/apache/arrow-datafusion.git", rev = "c3fc0c75af5ff2ebb99dba197d9d2ccd83eb5952" }

Review comment:
       Ah ok. Let's do it via a hash change then for now?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] jorgecarleitao commented on a change in pull request #503: Implement missing join types for Python dataframe

Posted by GitBox <gi...@apache.org>.
jorgecarleitao commented on a change in pull request #503:
URL: https://github.com/apache/arrow-datafusion/pull/503#discussion_r645665096



##########
File path: datafusion/src/logical_plan/plan.rs
##########
@@ -50,6 +52,28 @@ pub enum JoinType {
     Anti,
 }
 
+impl FromStr for JoinType {

Review comment:
       This will tie the DataFusions' API to Python datafusion API at the naming level. I am not sure we should do that:
   
   names imo are not really datafusion's: Rust favors enums over strings. They are relevant in Python because in Python strings are prevalent. In this context, shouldn't the API for mapping a string to a join type remain specific to Pythons' implementation?

##########
File path: python/Cargo.toml
##########
@@ -31,7 +31,7 @@ libc = "0.2"
 tokio = { version = "1.0", features = ["macros", "rt", "rt-multi-thread", "sync"] }
 rand = "0.7"
 pyo3 = { version = "0.13.2", features = ["extension-module"] }
-datafusion = { git = "https://github.com/apache/arrow-datafusion.git", rev = "c3fc0c75af5ff2ebb99dba197d9d2ccd83eb5952" }

Review comment:
       This forces Python-datafusion to always use the latest datafusion release, which is not necessarily what we always want.
   
   We agreed to keep using frozen hashes and perform manual changes. The rational is that releases of datafusion-python should be pinned to a specific version of DataFusion, so that we can release independently.

##########
File path: datafusion/src/logical_plan/plan.rs
##########
@@ -50,6 +52,28 @@ pub enum JoinType {
     Anti,
 }
 
+impl FromStr for JoinType {
+    type Err = DataFusionError;
+
+    fn from_str(s: &str) -> Result<Self, Self::Err> {
+        match s {
+            "inner" => Ok(JoinType::Inner),
+            "left" => Ok(JoinType::Left),
+            "right" => Ok(JoinType::Right),
+            "full" => Ok(JoinType::Full),
+            "semi" => Ok(JoinType::Semi),
+            "anti" => Ok(JoinType::Anti),
+            how => {
+                return Err(DataFusionError::Internal(format!(

Review comment:
       This is not an internal error, as people would be able to write anything from Python.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] codecov-commenter commented on pull request #503: Implement missing join types for Python dataframe

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #503:
URL: https://github.com/apache/arrow-datafusion/pull/503#issuecomment-854828790


   # [Codecov](https://codecov.io/gh/apache/arrow-datafusion/pull/503?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#503](https://codecov.io/gh/apache/arrow-datafusion/pull/503?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (38fc164) into [master](https://codecov.io/gh/apache/arrow-datafusion/commit/ac9d4ae7c6ecde354fe95a9ecafcb715e943f988?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (ac9d4ae) will **increase** coverage by `0.02%`.
   > The diff coverage is `0.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/arrow-datafusion/pull/503/graphs/tree.svg?width=650&height=150&src=pr&token=JXwWBKD3D9&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/arrow-datafusion/pull/503?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master     #503      +/-   ##
   ==========================================
   + Coverage   75.92%   75.95%   +0.02%     
   ==========================================
     Files         154      155       +1     
     Lines       26381    26444      +63     
   ==========================================
   + Hits        20031    20086      +55     
   - Misses       6350     6358       +8     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/arrow-datafusion/pull/503?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [datafusion/src/logical\_plan/plan.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGF0YWZ1c2lvbi9zcmMvbG9naWNhbF9wbGFuL3BsYW4ucnM=) | `78.35% <0.00%> (-2.72%)` | :arrow_down: |
   | [python/src/dataframe.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHl0aG9uL3NyYy9kYXRhZnJhbWUucnM=) | `0.00% <0.00%> (ø)` | |
   | [datafusion/src/test\_util.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGF0YWZ1c2lvbi9zcmMvdGVzdF91dGlsLnJz) | `96.49% <0.00%> (ø)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/arrow-datafusion/pull/503?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/arrow-datafusion/pull/503?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [ac9d4ae...38fc164](https://codecov.io/gh/apache/arrow-datafusion/pull/503?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] Dandandan commented on a change in pull request #503: Implement missing join types for Python dataframe

Posted by GitBox <gi...@apache.org>.
Dandandan commented on a change in pull request #503:
URL: https://github.com/apache/arrow-datafusion/pull/503#discussion_r645681364



##########
File path: datafusion/src/logical_plan/plan.rs
##########
@@ -50,6 +52,28 @@ pub enum JoinType {
     Anti,
 }
 
+impl FromStr for JoinType {

Review comment:
       Agreed, will change it.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] jorgecarleitao commented on a change in pull request #503: Implement missing join types for Python dataframe

Posted by GitBox <gi...@apache.org>.
jorgecarleitao commented on a change in pull request #503:
URL: https://github.com/apache/arrow-datafusion/pull/503#discussion_r645686104



##########
File path: datafusion/src/logical_plan/plan.rs
##########
@@ -50,6 +52,28 @@ pub enum JoinType {
     Anti,
 }
 
+impl FromStr for JoinType {

Review comment:
       music to my hears... I ❤️ agree.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] Dandandan commented on a change in pull request #503: Implement missing join types for Python dataframe

Posted by GitBox <gi...@apache.org>.
Dandandan commented on a change in pull request #503:
URL: https://github.com/apache/arrow-datafusion/pull/503#discussion_r645684310



##########
File path: datafusion/src/logical_plan/plan.rs
##########
@@ -50,6 +52,28 @@ pub enum JoinType {
     Anti,
 }
 
+impl FromStr for JoinType {

Review comment:
       IMO it would be better if the python api also used enum (or typed string union) too, at least for autocompletion and optional type checking, but keeping it for now as strings.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org