You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "kosiew (via GitHub)" <gi...@apache.org> on 2024/11/07 13:50:19 UTC
[PR] Add list_cat, list_concat, list_repeat [datafusion-python]
kosiew opened a new pull request, #942:
URL: https://github.com/apache/datafusion-python/pull/942
# Which issue does this PR close?
Completes 3 tasks in #463
# 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.
-->
This PR adds new functions `list_cat`, `list_concat`, `list_repeat`.
# 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.
-->
Added the `list_cat`, `list_concat`, `list_repeat` functions.
Updated the Python bindings in functions.py and provided unit tests for empty in test_functions.py.
Updated the documentation (expressions.rst) to include examples on how to use the new functions.
# Are there any user-facing changes?
<!--
If there are user-facing changes then we may require documentation to be updated before approving the PR.
-->
The array_empty function is now available for users working with arrays. It is exposed both in Rust and Python, allowing users to check whether arrays are empty within their DataFusion queries.
There are no breaking changes to public APIs.
<!--
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.
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] Add list_cat, list_concat, list_repeat [datafusion-python]
Posted by "timsaucer (via GitHub)" <gi...@apache.org>.
timsaucer commented on code in PR #942:
URL: https://github.com/apache/datafusion-python/pull/942#discussion_r1834213541
##########
docs/source/user-guide/common-operations/expressions.rst:
##########
@@ -110,6 +110,35 @@ This function returns an integer indicating the total number of elements in the
In this example, the `num_elements` column will contain `3` for both rows.
+To concatenate two arrays, you can use the function :py:func:`datafusion.functions.list_cat` or :py:func:`datafusion.functions.list_concat`.
+These functions return a new array that is the concatenation of the input arrays.
Review Comment:
I recommend we change all references in this file to the `array_` versions rather than the `list_` versions since I think the primary method is `array_` and the `list_` version is a convenient alias.
--
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] Add list_cat, list_concat, list_repeat [datafusion-python]
Posted by "timsaucer (via GitHub)" <gi...@apache.org>.
timsaucer merged PR #942:
URL: https://github.com/apache/datafusion-python/pull/942
--
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] Add list_cat, list_concat, list_repeat [datafusion-python]
Posted by "kosiew (via GitHub)" <gi...@apache.org>.
kosiew commented on code in PR #942:
URL: https://github.com/apache/datafusion-python/pull/942#discussion_r1837383871
##########
docs/source/user-guide/common-operations/expressions.rst:
##########
@@ -110,6 +110,35 @@ This function returns an integer indicating the total number of elements in the
In this example, the `num_elements` column will contain `3` for both rows.
+To concatenate two arrays, you can use the function :py:func:`datafusion.functions.list_cat` or :py:func:`datafusion.functions.list_concat`.
+These functions return a new array that is the concatenation of the input arrays.
Review Comment:
I have changed the list_ references to array_ references.
--
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] Add list_cat, list_concat, list_repeat [datafusion-python]
Posted by "timsaucer (via GitHub)" <gi...@apache.org>.
timsaucer commented on code in PR #942:
URL: https://github.com/apache/datafusion-python/pull/942#discussion_r1837392562
##########
docs/source/user-guide/common-operations/expressions.rst:
##########
@@ -110,6 +110,35 @@ This function returns an integer indicating the total number of elements in the
In this example, the `num_elements` column will contain `3` for both rows.
+To concatenate two arrays, you can use the function :py:func:`datafusion.functions.list_cat` or :py:func:`datafusion.functions.list_concat`.
+These functions return a new array that is the concatenation of the input arrays.
Review Comment:
Thank you! I’ll wait for CI to pass and then I’ll merge. Nice work on this PR!
--
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