snowflake.snowpark.functions.is_boolean¶
- snowflake.snowpark.functions.is_boolean(col: ColumnOrName) Column [source]¶
Returns true if the specified VARIANT column contains a boolean value.
Examples:
>>> from snowflake.snowpark.types import StructField, VariantType >>> df = session.create_dataframe([[True, 'X']], schema=["a", "b"]) >>> df.select(is_boolean(to_variant(df["a"])).alias("boolean"), is_boolean(to_variant(df["b"])).alias("varchar")).collect() [Row(BOOLEAN=True, VARCHAR=False)]