I have a fancy Python script running in my PythonCaller, but I want to use a "Group By" logic to process my features. I'd rather not have to manually split my features and plop down a PythonCaller for each separate stream. Is there an easy way to do this within the Python script? Or any way??
Solved
How do I set a Group By in a PythonCaller?
Best answer by nathanatsafe
There seem to be two ways to use "Group By" logic with a PythonCaller.
1) Wrap your PythonCaller in a custom transformer and harness the power of the "Parallel Process By" advanced parameter. See this post for more details.
2) Use the PythonCaller class template and build a dictionary in the input method. The dictionary keys will become unique groups, while the values for each key will contain a list of features belonging to the group. With this method, most of your processing will have to take place in the close method, after looping through each key in the dictionary and/or each list of features mapped to each key.
Take a look at the sample script for more details!
Also don't forget to head over and vote on this idea, or post your own PythonCaller wishlist!
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

