code: def test_nullable_type(self, DMatrixT) -> None:
      from xgboost.data import is_pd_cat_dtype
  
      for orig, df in pd_dtypes():
          if hasattr(df.dtypes, "__iter__"):
              enable_categorical = any(
                  is_pd_cat_dtype(dtype) for dtype in df.dtypes
              )
          else:
              # series
              enable_categorical = is_pd_cat_dtype(df.dtype)
  
          f0_orig = (
              orig[orig.columns[0]]
              if isinstance(orig, pd.DataFrame)
              else orig
          )
          f0 = df[df.columns[0]] if isinstance(df, pd.DataFrame) else df
          y_orig = f0_orig.astype(pd.Float32Dtype()).fillna(0)
          y = f0.astype(pd.Float32Dtype()).fillna(0)
  
          m_orig = DMatrixT(
              orig, enable_categorical=enable_categorical, label=y_orig
          )
          # extension types
          copy = df.copy()
          m_etype = DMatrixT(
              df, enable_categorical=enable_categorical, label=y
          )
          # no mutation
          assert df.equals(copy)
          # different from pd.BooleanDtype(), None is converted to False with bool
          if hasattr(orig.dtypes, "__iter__") and any(
              dtype == "bool" for dtype in orig.dtypes
          ):
              assert not tm.predictor_equal(m_orig, m_etype)
          else:
              assert tm.predictor_equal(m_orig, m_etype)
  
          np.testing.assert_allclose(
              m_orig.get_label(), m_etype.get_label()
          )
          np.testing.assert_allclose(
              m_etype.get_label(), y.values.astype(np.float32)
          )
  
          if isinstance(df, pd.DataFrame):
              f0 = df["f0"]
              with pytest.raises(
                  ValueError, match="Label contains NaN"
              ):
                  xgb.DMatrix(
                      df, f0, enable_categorical=enable_categorical
                  )
  
imports: from typing import Type
  import numpy
  import pytest
  import xgboost
  from xgboost import testing
  from xgboost.core import DataSplitMode
  from xgboost.testing.data import pd_arrow_dtypes, pd_dtypes, run_base_margin_info
label_desc: Use image node_id 10 for calling the TestPandas obj's underlying member method code with example usage: obj.test_nullable_type(DMatrixT) without return types