parameters: (self, context, other)
return_statement: return MaskedType(unified)
docstring: Often within a UDF an instance arises where a variable could
          be a `MaskedType`, an `NAType`, or a literal based off
          the data at runtime, for example the variable `ret` here:
  
          def f(x):
              if x == 1:
                  ret = x
              elif x > 2:
                  ret = 1
              else:
                  ret = cudf.NA
              return ret
  
          When numba analyzes this function it will eventually figure
          out that the variable `ret` could be any of the three types
          from above. This scenario will only work if numba knows how
          to find some kind of common type between the possibilities,
          and this function implements that - the goal is to return a
          common type when comparing `self` to other.
docstring_summary: Often within a UDF an instance arises where a variable could
          be a `MaskedType`, an `NAType`, or a literal based off
          the data at runtime, for example the variable `ret` here:
docstring_tokens: Often within a UDF an instance arises where a variable could be a MaskedType an NAType or a literal based off the data at runtime for example the variable ret here :
function: def unify(self, context, other):
          """
          Often within a UDF an instance arises where a variable could
          be a `MaskedType`, an `NAType`, or a literal based off
          the data at runtime, for example the variable `ret` here:
  
          def f(x):
              if x == 1:
                  ret = x
              elif x > 2:
                  ret = 1
              else:
                  ret = cudf.NA
              return ret
  
          When numba analyzes this function it will eventually figure
          out that the variable `ret` could be any of the three types
          from above. This scenario will only work if numba knows how
          to find some kind of common type between the possibilities,
          and this function implements that - the goal is to return a
          common type when comparing `self` to other.
  
          """
  
          # If we have Masked and NA, the output should be a
          # MaskedType with the original type as its value_type
          if isinstance(other, NAType):
              return self
  
          # two MaskedType unify to a new MaskedType whose value_type
          # is the result of unifying `self` and `other` `value_type`
          elif isinstance(other, MaskedType):
              return MaskedType(
                  context.unify_pairs(self.value_type, other.value_type)
              )
  
          # if we have MaskedType and something that results in a
          # scalar, unify between the MaskedType's value_type
          # and that other thing
          unified = context.unify_pairs(self.value_type, other)
          if unified is None:
              # The value types don't unify, so there is no unified masked type
              return None
  
          return MaskedType(unified)
function_tokens: def unify ( self , context , other ) : # If we have Masked and NA, the output should be a # MaskedType with the original type as its value_type if isinstance ( other , NAType ) : return self # two MaskedType unify to a new MaskedType whose value_type # is the result of unifying `self` and `other` `value_type` elif isinstance ( other , MaskedType ) : return MaskedType ( context . unify_pairs ( self . value_type , other . value_type ) ) # if we have MaskedType and something that results in a # scalar, unify between the MaskedType's value_type # and that other thing unified = context . unify_pairs ( self . value_type , other ) if unified is None : # The value types don't unify, so there is no unified masked type return None return MaskedType ( unified )