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 2025/07/27 07:41:41 UTC
[PR] Fix Python UDAF Accumulator Interface example to Properly Handle State and Updates with List[Array] Types [datafusion-python]
kosiew opened a new pull request, #1192:
URL: https://github.com/apache/datafusion-python/pull/1192
## Which issue does this PR close?
- Closes #1190
## Rationale for this change
This PR updates the `MyAccumulator` implementation in the Python UDAF example to properly handle updates and state using `list[pa.Array]` types, aligning with the expected interface in newer versions of PyArrow. Without this change, the accumulator may behave incorrectly or fail when integrating with systems expecting lists of arrays.
## What changes are included in this PR?
- Updated `update()` method signature to accept `list[pa.Array]` instead of a single `pa.Array`.
- Modified the `merge()` method to correctly index into the first element of `states`, assuming it's a list.
- Changed `state()` to return a list of `pa.Array` instead of a single `pa.Array` for consistency with updated interface expectations.
## Are these changes tested?
The patch updates an example file, which may be executed to validate expected behavior. If automated tests are not available for this specific UDAF example, manual verification is recommended.
## Are there any user-facing changes?
Yes, this affects users who are following or adapting the `sql-using-python-udaf.py` example. They should now provide and expect `list[pa.Array]` for `update`, `merge`, and `state` methods, in alignment with PyArrow expectations.
--
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] Fix Python UDAF Accumulator Interface example to Properly Handle State and Updates with List[Array] Types [datafusion-python]
Posted by "timsaucer (via GitHub)" <gi...@apache.org>.
timsaucer merged PR #1192:
URL: https://github.com/apache/datafusion-python/pull/1192
--
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] Fix Python UDAF Accumulator Interface example to Properly Handle State and Updates with List[Array] Types [datafusion-python]
Posted by "kosiew (via GitHub)" <gi...@apache.org>.
kosiew commented on PR #1192:
URL: https://github.com/apache/datafusion-python/pull/1192#issuecomment-3130210373
@timsaucer , You're welcome.
--
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