snowflake.snowpark.Row.asDict

Row.asDict(recursive: bool = False) Dict[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.26.0/snowpark-python/src/snowflake/snowpark/row.py#L266-L285)

Convert to a dict if this row object has both keys and values.

Parameters:

recursive – Recursively convert child Row objects to dicts. Default is False.

>>> row = Row(name1=1, name2=2, name3=Row(childname=3))
>>> row.as_dict()
{'name1': 1, 'name2': 2, 'name3': Row(childname=3)}
>>> row.as_dict(True)
{'name1': 1, 'name2': 2, 'name3': {'childname': 3}}
Copy
Language: English