>>> from snowflake.snowpark.types import StructType, StructField, VariantType, StringType
>>> df = session.create_dataframe(
... [["key_1", "one"], ["key_2", None]],
... schema=StructType([StructField("k", StringType()), StructField("v", VariantType())])
... )
>>> df.select(object_construct_keep_null(col("k"), col("v")).alias("result")).show()
--------------------
|"RESULT" |
--------------------
|{ |
| "key_1": "one" |
|} |
|{ |
| "key_2": null |
|} |
--------------------