def _check_dtype(self, dtype: Any, expected: type) -> bool:
    """Return True IFF dtype corresponds to expected.

    Note that for non-nullable columns, dtype may equal type (e.g. np.int64), but for nullable
    columns the column type is actually an instance of a pandas dtype (e.g. pd.Int64Dtype)
    """
    assert expected != object, "expectation must be more specific than object"
    return dtype == expected or isinstance(dtype, expected)
Return True IFF dtype corresponds to expected.

    Note that for non-nullable columns, dtype may equal type (e.g. np.int64), but for nullable
    columns the column type is actually an instance of a pandas dtype (e.g. pd.Int64Dtype)
    
sourcecode/scoring/pandas_utils.py