PDG - Partition By Expression TOP - python expression problem

   1322   0   0
User Avatar
Member
102 posts
Joined: May 2013
Offline
I'm just investigating PDG workflows a bit for a project I'm working on and I'm having difficulty with the Partition By Expression TOP. In the example file there is a python expression :

1 if work_item.index >= 2 else 0

which if my understanding is correct should put everything that has index of 2 or greater in partition 1 and everything else in partition 0. However it puts everything in partition 0.

The example next to it has this expression :

1 if work_item.index >= 2 else -2

but has exactly the same result. Is there something wrong with the syntax? It's not erroring, it's just not working as expected…
  • Quick Links