code: def test_where_nullable_invalid_na(
      frame_or_series, any_numeric_ea_dtype
  ):
      # GH#44697
      arr = pd.array([1, 2, 3], dtype=any_numeric_ea_dtype)
      obj = frame_or_series(arr)
  
      mask = np.array([True, True, False], ndmin=obj.ndim).T
  
      msg = r"Invalid value '.*' for dtype (U?Int|Float)\d{1,2}"
  
      for null in tm.NP_NAT_OBJECTS + [pd.NaT]:
          # NaT is an NA value that we should *not* cast to pd.NA dtype
          with pytest.raises(TypeError, match=msg):
              obj.where(mask, null)
  
          with pytest.raises(TypeError, match=msg):
              obj.mask(mask, null)
  
imports: from datetime import datetime
  from hypothesis import given
  import numpy
  import pytest
  from pandas.core.dtypes.common import is_scalar
  import pandas
  from pandas import DataFrame, DatetimeIndex, Index, Series, StringDtype, Timestamp, date_range, isna
  import pandas._testing
  from pandas._testing._hypothesis import OPTIONAL_ONE_OF_ALL
label_desc: Use image node_id 11 for calling a global function with example usage: test_where_nullable_invalid_na(frame_or_series, any_numeric_ea_dtype) without return types