code: def reduce_fn(x):
      
      values = x.values if pd and isinstance(x, pd.Series) else x
      for v in values:
          if not is_nan(v):
              return v
      return np.NaN
docs: Aggregation function to get the first non-zero value.