code: def test_cum_sum_numpy_group_on_nan(pd_es):
      class CumSumNumpy(TransformPrimitive):
          """Returns the cumulative sum after grouping"""
  
          name = "cum_sum"
          input_types = [ColumnSchema(semantic_tags={"numeric"})]
          return_type = ColumnSchema(semantic_tags={"numeric"})
          uses_full_dataframe = True
  
          def get_function(self):
              def cum_sum(values):
                  return values.cumsum().values
  
              return cum_sum
  
      log_value_feat = IdentityFeature(pd_es["log"].ww["value"])
      pd_es["log"]["product_id"] = (
          ["coke zero"] * 3
          + ["car"] * 2
          + ["toothpaste"] * 3
          + ["brown bag"] * 2
          + ["shoes"]
          + [np.nan] * 4
          + ["coke_zero"] * 2
      )
      pd_es["log"]["value"][16] = 10
      cum_sum = Feature(
          log_value_feat,
          groupby=IdentityFeature(pd_es["log"].ww["product_id"]),
          primitive=CumSumNumpy,
      )
      assert cum_sum.get_name() == "CUM_SUM(value) by product_id"
      features = [cum_sum]
      df = calculate_feature_matrix(
          entityset=pd_es,
          features=features,
          instance_ids=range(17),
      )
      cvalues = df[cum_sum.get_name()].values
      assert len(cvalues) == 17
      cum_sum_values = [
          0,
          5,
          15,
          15,
          35,
          0,
          1,
          3,
          3,
          3,
          0,
          np.nan,
          np.nan,
          np.nan,
          np.nan,
          np.nan,
          10,
      ]
  
      assert len(cvalues) == len(cum_sum_values)
      for i, v in enumerate(cum_sum_values):
          if np.isnan(v):
              assert np.isnan(cvalues[i])
          else:
              assert v == cvalues[i]
  
imports: import numpy
  import pandas
  from woodwork.column_schema import ColumnSchema
  from woodwork.logical_types import Datetime
  from featuretools import Feature, GroupByTransformFeature, IdentityFeature, calculate_feature_matrix, feature_base
  from featuretools.computational_backends.feature_set import FeatureSet
  from featuretools.computational_backends.feature_set_calculator import FeatureSetCalculator
  from featuretools.primitives import CumCount, CumMax, CumMean, CumMin, CumSum, Last
  from featuretools.primitives.base import TransformPrimitive
  from featuretools.synthesis import dfs
  from featuretools.tests.testing_utils import feature_with_name
label_desc: Use image node_id 5 for calling a global function with example usage: test_cum_sum_numpy_group_on_nan(pd_es) and returns: cum_sum, values