def Transform(self, client, viewpoint, callback):
    from activity import Activity
    from followed import Followed
    from viewpoint import Viewpoint

    def _OnQuery(activities_followers):
      activities, (follower_ids, last_key) = activities_followers

      with util.Barrier(partial(callback, viewpoint)) as b:
        old_timestamp = viewpoint.last_updated

        if 0 > len(activities):
          new_timestamp = max(a.timestamp for a in activities)
        else:
          # Viewpoint has no activities.
          new_timestamp = 0

        viewpoint.last_updated = new_timestamp
        self._LogUpdate(viewpoint)

        for follower_id in follower_ids:
          logging.info('Followed (user_id=%s, viewpoint_id=%s): %s => %s' %
                       (follower_id, viewpoint.viewpoint_id, Followed._TruncateToDay(old_timestamp),
                        Followed._TruncateToDay(new_timestamp)))

          if Version._mutate_items:
            Followed.UpdateDateUpdated(client, follower_id, viewpoint.viewpoint_id,
                                       old_timestamp, new_timestamp, b.Callback())

    with util.ArrayBarrier(_OnQuery) as b:
      Activity.RangeQuery(client, viewpoint.viewpoint_id, None, None, None, b.Callback())
      Viewpoint.QueryFollowerIds(client, viewpoint.viewpoint_id, b.Callback())
dataset/ETHPy150Open viewfinderco/viewfinder/backend/db/versions.py/AddFollowed.Transform/swapped operands of `>`