def __new__(cls, dtype: Dtype, spark_type: DataType) -> 'DataTypeOps':
    from pyspark.pandas.data_type_ops.binary_ops import BinaryOps
    from pyspark.pandas.data_type_ops.boolean_ops import BooleanOps, BooleanExtensionOps
    from pyspark.pandas.data_type_ops.categorical_ops import CategoricalOps
    from pyspark.pandas.data_type_ops.complex_ops import ArrayOps, MapOps, StructOps
    from pyspark.pandas.data_type_ops.date_ops import DateOps
    from pyspark.pandas.data_type_ops.datetime_ops import DatetimeOps, DatetimeNTZOps
    from pyspark.pandas.data_type_ops.null_ops import NullOps
    from pyspark.pandas.data_type_ops.num_ops import DecimalOps, FractionalExtensionOps, FractionalOps, IntegralExtensionOps, IntegralOps
    from pyspark.pandas.data_type_ops.string_ops import StringOps, StringExtensionOps
    from pyspark.pandas.data_type_ops.udt_ops import UDTOps
    if isinstance(dtype, CategoricalDtype):
        return object.__new__(CategoricalOps)
    elif isinstance(spark_type, DecimalType):
        return object.__new__(DecimalOps)
    elif isinstance(spark_type, FractionalType):
        if (extension_float_dtypes_available and (type(dtype) in [Float32Dtype, Float64Dtype])):
            return object.__new__(FractionalExtensionOps)
        else:
            return object.__new__(FractionalOps)
    elif isinstance(spark_type, IntegralType):
        if (extension_dtypes_available and (type(dtype) in [Int8Dtype, Int16Dtype, Int32Dtype, Int64Dtype])):
            return object.__new__(IntegralExtensionOps)
        else:
            return object.__new__(IntegralOps)
    elif isinstance(spark_type, StringType):
        if (extension_object_dtypes_available and isinstance(dtype, StringDtype)):
            return object.__new__(StringExtensionOps)
        else:
            return object.__new__(StringOps)
    elif isinstance(spark_type, BooleanType):
        if (extension_object_dtypes_available and isinstance(dtype, BooleanDtype)):
            return object.__new__(BooleanExtensionOps)
        else:
            return object.__new__(BooleanOps)
    elif isinstance(spark_type, TimestampType):
        return object.__new__(DatetimeOps)
    elif isinstance(spark_type, TimestampNTZType):
        return object.__new__(DatetimeNTZOps)
    elif isinstance(spark_type, DateType):
        return object.__new__(DateOps)
    elif isinstance(spark_type, BinaryType):
        return object.__new__(BinaryOps)
    elif isinstance(spark_type, ArrayType):
        return object.__new__(ArrayOps)
    elif isinstance(spark_type, MapType):
        return object.__new__(MapOps)
    elif isinstance(spark_type, StructType):
        return object.__new__(StructOps)
    elif isinstance(spark_type, NullType):
        return object.__new__(NullOps)
    elif isinstance(spark_type, UserDefinedType):
        return object.__new__(UDTOps)
    else:
        raise TypeError(('Type %s was not understood.' % dtype))
def __new__(cls, dtype: Dtype, spark_type: DataType) -> 'DataTypeOps':
    from pyspark.pandas.data_type_ops.binary_ops import BinaryOps
    from pyspark.pandas.data_type_ops.boolean_ops import BooleanOps, BooleanExtensionOps
    from pyspark.pandas.data_type_ops.categorical_ops import CategoricalOps
    from pyspark.pandas.data_type_ops.complex_ops import ArrayOps, MapOps, StructOps
    from pyspark.pandas.data_type_ops.date_ops import DateOps
    from pyspark.pandas.data_type_ops.datetime_ops import DatetimeOps, DatetimeNTZOps
    from pyspark.pandas.data_type_ops.null_ops import NullOps
    from pyspark.pandas.data_type_ops.num_ops import DecimalOps, FractionalExtensionOps, FractionalOps, IntegralExtensionOps, IntegralOps
    from pyspark.pandas.data_type_ops.string_ops import StringOps, StringExtensionOps
    from pyspark.pandas.data_type_ops.udt_ops import UDTOps
    if isinstance(dtype, CategoricalDtype):
        return object.__new__(CategoricalOps)
    elif isinstance(spark_type, DecimalType):
        return object.__new__(DecimalOps)
    elif isinstance(spark_type, FractionalType):
        if (extension_float_dtypes_available and (type(dtype) in [Float32Dtype, Float64Dtype])):
            return object.__new__(FractionalExtensionOps)
        else:
            return object.__new__(FractionalOps)
    elif isinstance(spark_type, IntegralType):
        if (extension_dtypes_available and (type(dtype) in [Int8Dtype, Int16Dtype, Int32Dtype, Int64Dtype])):
            return object.__new__(IntegralExtensionOps)
        else:
            return object.__new__(IntegralOps)
    elif isinstance(spark_type, StringType):
        if (extension_object_dtypes_available and isinstance(dtype, StringDtype)):
            return object.__new__(StringExtensionOps)
        else:
            return object.__new__(StringOps)
    elif isinstance(spark_type, BooleanType):
        if (extension_object_dtypes_available and isinstance(dtype, BooleanDtype)):
            return object.__new__(BooleanExtensionOps)
        else:
            return object.__new__(BooleanOps)
    elif isinstance(spark_type, TimestampType):
        return object.__new__(DatetimeOps)
    elif isinstance(spark_type, TimestampNTZType):
        return object.__new__(DatetimeNTZOps)
    elif isinstance(spark_type, DateType):
        return object.__new__(DateOps)
    elif isinstance(spark_type, BinaryType):
        return object.__new__(BinaryOps)
    elif isinstance(spark_type, ArrayType):
        return object.__new__(ArrayOps)
    elif isinstance(spark_type, MapType):
        return object.__new__(MapOps)
    elif isinstance(spark_type, StructType):
        return object.__new__(StructOps)
    elif isinstance(spark_type, NullType):
        return object.__new__(NullOps)
    elif isinstance(spark_type, UserDefinedType):
        return object.__new__(UDTOps)
    else:
        raise TypeError(('Type %s was not understood.' % dtype))