def transform_boolean_operand_to_numeric(operand: Any, *, spark_type: Optional[DataType]=None) -> Any:
    'Transform boolean operand to numeric.\n\n    If the `operand` is:\n        - a boolean IndexOpsMixin, transform the `operand` to the `spark_type`.\n        - a boolean literal, transform to the int value.\n    Otherwise, return the operand as it is.\n    '
    from pyspark.pandas.base import IndexOpsMixin
    if (isinstance(operand, IndexOpsMixin) and isinstance(operand.spark.data_type, BooleanType)):
        assert spark_type, 'spark_type must be provided if the operand is a boolean IndexOpsMixin'
        assert isinstance(spark_type, NumericType), 'spark_type must be NumericType'
        dtype = spark_type_to_pandas_dtype(spark_type, use_extension_dtypes=operand._internal.data_fields[0].is_extension_dtype)
        return operand._with_new_scol(operand.spark.column.cast(spark_type), field=operand._internal.data_fields[0].copy(dtype=dtype, spark_type=spark_type))
    elif isinstance(operand, bool):
        return int(operand)
    else:
        return operand
Transform boolean operand to numeric.

If the `operand` is:
    - a boolean IndexOpsMixin, transform the `operand` to the `spark_type`.
    - a boolean literal, transform to the int value.
Otherwise, return the operand as it is.
def transform_boolean_operand_to_numeric(operand: Any, *, spark_type: Optional[DataType]=None) -> Any:
    'Transform boolean operand to numeric.\n\n    If the `operand` is:\n        - a boolean IndexOpsMixin, transform the `operand` to the `spark_type`.\n        - a boolean literal, transform to the int value.\n    Otherwise, return the operand as it is.\n    '
    from pyspark.pandas.base import IndexOpsMixin
    if (isinstance(operand, IndexOpsMixin) and isinstance(operand.spark.data_type, BooleanType)):
        assert spark_type, 'spark_type must be provided if the operand is a boolean IndexOpsMixin'
        assert isinstance(spark_type, NumericType), 'spark_type must be NumericType'
        dtype = spark_type_to_pandas_dtype(spark_type, use_extension_dtypes=operand._internal.data_fields[0].is_extension_dtype)
        return operand._with_new_scol(operand.spark.column.cast(spark_type), field=operand._internal.data_fields[0].copy(dtype=dtype, spark_type=spark_type))
    elif isinstance(operand, bool):
        return int(operand)
    else:
        return operand