You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "timsaucer (via GitHub)" <gi...@apache.org> on 2024/07/24 12:53:56 UTC

[PR] Bugfix: Calling count with None arguments [datafusion-python]

timsaucer opened a new pull request, #768:
URL: https://github.com/apache/datafusion-python/pull/768

   # Which issue does this PR close?
   
   None
   
    # Rationale for this change
   
   This is a two line bugfix.
   
   # What changes are included in this PR?
   
   If the user calls `count()` it should internally use `count_star()`
   
   # Are there any user-facing changes?
   None


-- 
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.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Bugfix: Calling count with None arguments [datafusion-python]

Posted by "timsaucer (via GitHub)" <gi...@apache.org>.
timsaucer commented on PR #768:
URL: https://github.com/apache/datafusion-python/pull/768#issuecomment-2250473990

   Excellent suggestion. Pushed the change.


-- 
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.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Bugfix: Calling count with None arguments [datafusion-python]

Posted by "timsaucer (via GitHub)" <gi...@apache.org>.
timsaucer commented on PR #768:
URL: https://github.com/apache/datafusion-python/pull/768#issuecomment-2249996193

   In regards to aliases, I do think putting them on the wrappers makes sense. One thing I didn't do with #750 was to remove the alias function definitions on the rust side, even when there is an alias in the python wrapper. I'll add an issue to make sure that gets cleaned up.
   
   Yes, `count(None, distinct = True)` would be a problem. What do you think - should we update `count_star` or maybe just add to the docstring to say that `None` arguments is a special case that ignores `distinct`? 
   
   In regards to `AggregateBuilder` would you be willing to wait one more release? We just merged in https://github.com/apache/datafusion/pull/11550 which I'm guessing will be in datafusion 41.0. With that we get both the aggregate functions and window functions using the same API. That might make the minimal amount of churn. But if you do want to get in the aggregates for datafusion-python 40.0 I can probably knock that out in the next couple of days.
   


-- 
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.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Bugfix: Calling count with None arguments [datafusion-python]

Posted by "andygrove (via GitHub)" <gi...@apache.org>.
andygrove merged PR #768:
URL: https://github.com/apache/datafusion-python/pull/768


-- 
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.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Bugfix: Calling count with None arguments [datafusion-python]

Posted by "Michael-J-Ward (via GitHub)" <gi...@apache.org>.
Michael-J-Ward commented on PR #768:
URL: https://github.com/apache/datafusion-python/pull/768#issuecomment-2250309086

   > In regards to AggregateBuilder would you be willing to wait one more release? We just merged in https://github.com/apache/datafusion/pull/11550 which I'm guessing will be in datafusion 41.0.
   
   First, excellent upstream PR. I literally have "improve upstream Builder API" in my post upgrade hit-list, so I'm very happy to see that you've knocked it out.
   
   Second, we can absolutely wait till 41. I've been slow to the 40 upgrade, so let's get it out the door first.
   
   >  What do you think - should we update count_star or maybe just add to the docstring to say that None arguments is a special case that ignores distinct?
   
   Could `count(None, distinct = True)` map to `count(lit(1), distinct=True)` instead of `count_star()`? And before that, do we need to support `count(None)` at all?


-- 
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.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Bugfix: Calling count with None arguments [datafusion-python]

Posted by "Michael-J-Ward (via GitHub)" <gi...@apache.org>.
Michael-J-Ward commented on PR #768:
URL: https://github.com/apache/datafusion-python/pull/768#issuecomment-2249237406

   In #771, I flirted with the idea of removing `count_star` from the Rust side, but then added it back in for this release. It's really just porcelain for `count(lit(1))` (I think).
   
   Now that we have the benefit of the `python` wrappers, do you think we should try to push aliases such as this into the python side?


-- 
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.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org