code: def check_reduce(self, ser: pd.Series, op_name: str, skipna: bool):
      if op_name == "median":
          res_op = getattr(ser, op_name)
  
          alt = ser.astype("int64")
  
          exp_op = getattr(alt, op_name)
          result = res_op(skipna=skipna)
          expected = exp_op(skipna=skipna)
          # error: Item "dtype[Any]" of "dtype[Any] | ExtensionDtype" has no
          # attribute "freq"
          freq = ser.dtype.freq  # type: ignore[union-attr]
          expected = Period._from_ordinal(int(expected), freq=freq)
          tm.assert_almost_equal(result, expected)
  
      else:
          return super().check_reduce(ser, op_name, skipna)
  
imports: from __future__ import annotations
  from typing import TYPE_CHECKING
  import numpy
  import pytest
  from pandas._libs import Period, iNaT
  from pandas.compat import is_platform_windows
  from pandas.compat.numpy import np_version_gte1p24
  from pandas.core.dtypes.dtypes import PeriodDtype
  import pandas._testing
  from pandas.core.arrays import PeriodArray
  from pandas.tests.extension import base
label_desc: Use image node_id 4 for calling the TestPeriodArray obj's underlying member method code with example usage: obj.check_reduce(ser, op_name, skipna) and returns: super