def _as_bool_type(index_ops: IndexOpsLike, dtype: Union[(str, type, Dtype)]) -> IndexOpsLike:
    'Cast `index_ops` to BooleanType Spark type, given `dtype`.'
    spark_type = BooleanType()
    if isinstance(dtype, extension_dtypes):
        scol = index_ops.spark.column.cast(spark_type)
    else:
        scol = F.when(index_ops.spark.column.isNull(), SF.lit(False)).otherwise(index_ops.spark.column.cast(spark_type))
    return index_ops._with_new_scol(scol, field=index_ops._internal.data_fields[0].copy(dtype=dtype, spark_type=spark_type))
Cast `index_ops` to BooleanType Spark type, given `dtype`.
def _as_bool_type(index_ops: IndexOpsLike, dtype: Union[(str, type, Dtype)]) -> IndexOpsLike:
    
    spark_type = BooleanType()
    if isinstance(dtype, extension_dtypes):
        scol = index_ops.spark.column.cast(spark_type)
    else:
        scol = F.when(index_ops.spark.column.isNull(), SF.lit(False)).otherwise(index_ops.spark.column.cast(spark_type))
    return index_ops._with_new_scol(scol, field=index_ops._internal.data_fields[0].copy(dtype=dtype, spark_type=spark_type))