>>> from snowflake.snowpark.types import StructType, StructField, VariantType, StringType
>>> df = session.create_dataframe(
... [["name", "Joe"], ["zip", "98004"],["age", None], [None, "value"]],
... schema=StructType([StructField("k", StringType()), StructField("v", VariantType())])
... )
>>> df.select(object_construct(col("k"), col("v")).alias("result")).show()
--------------------
|"RESULT" |
--------------------
|{ |
| "name": "Joe" |
|} |
|{ |
| "zip": "98004" |
|} |
|{} |
|{} |
--------------------