You are viewing documentation about an older version (1.13.0). View latest version

snowflake.snowpark.Row.asDict

Row.asDict(recursive: bool = False) Dict[source]

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