

 Amazon Redshift will no longer support the creation of new Python UDFs starting Patch 198. Existing Python UDFs will continue to function until June 30, 2026. For more information, see the [ blog post ](https://aws.amazon.com/blogs/big-data/amazon-redshift-python-user-defined-functions-will-reach-end-of-support-after-june-30-2026/). 

# GET\$1NUMBER\$1ATTRIBUTES function
<a name="get_number_attributes"></a>

Returns a count of how many key-value pairs exist at the root level of a dictionary object.

## Syntax
<a name="get_number_attributes-syntax"></a>

```
GET_NUMBER_ATTRIBUTES( super_expression )
```

## Arguments
<a name="get_number_attributes-arguments"></a>

 *super\$1expression*   
A SUPER expression of dictionary form.

## Return type
<a name="get_number_attributes-return-type"></a>

The GET\$1NUMBER\$1ATTRIBUTES function returns an INT type.

## Note
<a name="get_number_attributes-note"></a>

This function only counts direct attributes and does not include pairs within nested dictionaries.

## Example
<a name="get_number_attributes-example"></a>

The following example shows the GET\$1NUMBER\$1ATTRIBUTES function.

```
SELECT GET_NUMBER_ATTRIBUTES(JSON_PARSE('{"a": 1, "b": 2, "c": 3}'));
 get_number_attributes
-----------------------
            3
(1 row)
```

The GET\$1NUMBER\$1ATTRIBUTES function only operates on the first level of the dictionary.

```
SELECT GET_NUMBER_ATTRIBUTES(JSON_PARSE('{"a": 1, "b": {"c": 3}}'));
 get_number_attributes
-----------------------
            2
(1 row)
```