:doc:`DataZone <../../datazone>` / Client / create_asset_filter

*******************
create_asset_filter
*******************



.. py:method:: DataZone.Client.create_asset_filter(**kwargs)

  

  Creates a data asset filter.

   

  Asset filters provide a sophisticated way to create controlled views of data assets by selecting specific columns or applying row-level filters. This capability is crucial for organizations that need to share data while maintaining security and privacy controls. For example, your database might be filtered to show only non-PII fields to certain users, or sales data might be filtered by region for different regional teams. Asset filters enable fine-grained access control while maintaining a single source of truth.

   

  Prerequisites:

   

  
  * A valid domain ( ``--domain-identifier``) must exist.
   
  * A data asset ( ``--asset-identifier``) must already be created under that domain.
   
  * The asset must have the referenced columns available in its schema for column-based filtering.
   
  * You cannot specify both ( ``columnConfiguration``, ``rowConfiguration``)at the same time.
  

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CreateAssetFilter>`_  


  **Request Syntax**
  ::

    response = client.create_asset_filter(
        domainIdentifier='string',
        assetIdentifier='string',
        name='string',
        description='string',
        configuration={
            'columnConfiguration': {
                'includedColumnNames': [
                    'string',
                ]
            },
            'rowConfiguration': {
                'rowFilter': {
                    'expression': {
                        'equalTo': {
                            'columnName': 'string',
                            'value': 'string'
                        },
                        'notEqualTo': {
                            'columnName': 'string',
                            'value': 'string'
                        },
                        'greaterThan': {
                            'columnName': 'string',
                            'value': 'string'
                        },
                        'lessThan': {
                            'columnName': 'string',
                            'value': 'string'
                        },
                        'greaterThanOrEqualTo': {
                            'columnName': 'string',
                            'value': 'string'
                        },
                        'lessThanOrEqualTo': {
                            'columnName': 'string',
                            'value': 'string'
                        },
                        'isNull': {
                            'columnName': 'string'
                        },
                        'isNotNull': {
                            'columnName': 'string'
                        },
                        'in': {
                            'columnName': 'string',
                            'values': [
                                'string',
                            ]
                        },
                        'notIn': {
                            'columnName': 'string',
                            'values': [
                                'string',
                            ]
                        },
                        'like': {
                            'columnName': 'string',
                            'value': 'string'
                        },
                        'notLike': {
                            'columnName': 'string',
                            'value': 'string'
                        }
                    },
                    'and': [
                        {'... recursive ...'},
                    ],
                    'or': [
                        {'... recursive ...'},
                    ]
                },
                'sensitive': True|False
            }
        },
        clientToken='string'
    )
    
  :type domainIdentifier: string
  :param domainIdentifier: **[REQUIRED]** 

    The ID of the domain in which you want to create an asset filter.

    

  
  :type assetIdentifier: string
  :param assetIdentifier: **[REQUIRED]** 

    The ID of the data asset.

    

  
  :type name: string
  :param name: **[REQUIRED]** 

    The name of the asset filter.

    

  
  :type description: string
  :param description: 

    The description of the asset filter.

    

  
  :type configuration: dict
  :param configuration: **[REQUIRED]** 

    The configuration of the asset filter.

    .. note::    This is a Tagged Union structure. Only one of the     following top level keys can be set: ``columnConfiguration``, ``rowConfiguration``. 

  
    - **columnConfiguration** *(dict) --* 

      The column configuration of the asset filter.

      

    
      - **includedColumnNames** *(list) --* 

        Specifies whether to include column names.

        

      
        - *(string) --* 

        
    
    
    - **rowConfiguration** *(dict) --* 

      The row configuration of the asset filter.

      

    
      - **rowFilter** *(dict) --* **[REQUIRED]** 

        The row filter.

        .. note::    This is a Tagged Union structure. Only one of the     following top level keys can be set: ``expression``, ``and``, ``or``. 

      
        - **expression** *(dict) --* 

          The expression of the row filter.

          .. note::    This is a Tagged Union structure. Only one of the     following top level keys can be set: ``equalTo``, ``notEqualTo``, ``greaterThan``, ``lessThan``, ``greaterThanOrEqualTo``, ``lessThanOrEqualTo``, ``isNull``, ``isNotNull``, ``in``, ``notIn``, ``like``, ``notLike``. 

        
          - **equalTo** *(dict) --* 

            The 'equal to' clause of the row filter expression.

            

          
            - **columnName** *(string) --* **[REQUIRED]** 

              The name of the column.

              

            
            - **value** *(string) --* **[REQUIRED]** 

              The value that might be equal to an expression.

              

            
          
          - **notEqualTo** *(dict) --* 

            The 'no equal to' clause of the row filter expression.

            

          
            - **columnName** *(string) --* **[REQUIRED]** 

              The name of the column.

              

            
            - **value** *(string) --* **[REQUIRED]** 

              The value that might not be equal to the expression.

              

            
          
          - **greaterThan** *(dict) --* 

            The 'greater than' clause of the row filter expression.

            

          
            - **columnName** *(string) --* **[REQUIRED]** 

              The name of the column.

              

            
            - **value** *(string) --* **[REQUIRED]** 

              The value that might be greater than an expression.

              

            
          
          - **lessThan** *(dict) --* 

            The 'less than' clause of the row filter expression.

            

          
            - **columnName** *(string) --* **[REQUIRED]** 

              The name of the column.

              

            
            - **value** *(string) --* **[REQUIRED]** 

              The value that might be less than the expression.

              

            
          
          - **greaterThanOrEqualTo** *(dict) --* 

            The 'greater than or equal to' clause of the filter expression.

            

          
            - **columnName** *(string) --* **[REQUIRED]** 

              The name of the column.

              

            
            - **value** *(string) --* **[REQUIRED]** 

              The value that might be greater than or equal to an expression.

              

            
          
          - **lessThanOrEqualTo** *(dict) --* 

            The 'less than or equal to' clause of the row filter expression.

            

          
            - **columnName** *(string) --* **[REQUIRED]** 

              The name of the column.

              

            
            - **value** *(string) --* **[REQUIRED]** 

              The value that might be less than or equal to an expression.

              

            
          
          - **isNull** *(dict) --* 

            The 'is null' clause of the row filter expression.

            

          
            - **columnName** *(string) --* **[REQUIRED]** 

              The name of the column.

              

            
          
          - **isNotNull** *(dict) --* 

            The 'is not null' clause of the row filter expression.

            

          
            - **columnName** *(string) --* **[REQUIRED]** 

              The name of the column.

              

            
          
          - **in** *(dict) --* 

            The 'in' clause of the row filter expression.

            

          
            - **columnName** *(string) --* **[REQUIRED]** 

              The name of the column.

              

            
            - **values** *(list) --* **[REQUIRED]** 

              The values that might be in the expression.

              

            
              - *(string) --* 

              
          
          
          - **notIn** *(dict) --* 

            The 'not in' clause of the row filter expression.

            

          
            - **columnName** *(string) --* **[REQUIRED]** 

              The name of the column.

              

            
            - **values** *(list) --* **[REQUIRED]** 

              The value that might not be in the expression.

              

            
              - *(string) --* 

              
          
          
          - **like** *(dict) --* 

            The 'like' clause of the row filter expression.

            

          
            - **columnName** *(string) --* **[REQUIRED]** 

              The name of the column.

              

            
            - **value** *(string) --* **[REQUIRED]** 

              The value that might be like the expression.

              

            
          
          - **notLike** *(dict) --* 

            The 'not like' clause of the row filter expression.

            

          
            - **columnName** *(string) --* **[REQUIRED]** 

              The name of the column.

              

            
            - **value** *(string) --* **[REQUIRED]** 

              The value that might not be like the expression.

              

            
          
        
        - **and** *(list) --* 

          The 'and' clause of the row filter.

          

        
          - *(dict) --* 

            The row filter.

            .. note::    This is a Tagged Union structure. Only one of the     following top level keys can be set: ``expression``, ``and``, ``or``. 

          
      
        - **or** *(list) --* 

          The 'or' clause of the row filter.

          

        
          - *(dict) --* 

            The row filter.

            .. note::    This is a Tagged Union structure. Only one of the     following top level keys can be set: ``expression``, ``and``, ``or``. 

          
      
      
      - **sensitive** *(boolean) --* 

        Specifies whether the row filter is sensitive.

        

      
    
  
  :type clientToken: string
  :param clientToken: 

    A unique, case-sensitive identifier that is provided to ensure the idempotency of the request.

    This field is autopopulated if not provided.

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'id': 'string',
          'domainId': 'string',
          'assetId': 'string',
          'name': 'string',
          'description': 'string',
          'status': 'VALID'|'INVALID',
          'configuration': {
              'columnConfiguration': {
                  'includedColumnNames': [
                      'string',
                  ]
              },
              'rowConfiguration': {
                  'rowFilter': {
                      'expression': {
                          'equalTo': {
                              'columnName': 'string',
                              'value': 'string'
                          },
                          'notEqualTo': {
                              'columnName': 'string',
                              'value': 'string'
                          },
                          'greaterThan': {
                              'columnName': 'string',
                              'value': 'string'
                          },
                          'lessThan': {
                              'columnName': 'string',
                              'value': 'string'
                          },
                          'greaterThanOrEqualTo': {
                              'columnName': 'string',
                              'value': 'string'
                          },
                          'lessThanOrEqualTo': {
                              'columnName': 'string',
                              'value': 'string'
                          },
                          'isNull': {
                              'columnName': 'string'
                          },
                          'isNotNull': {
                              'columnName': 'string'
                          },
                          'in': {
                              'columnName': 'string',
                              'values': [
                                  'string',
                              ]
                          },
                          'notIn': {
                              'columnName': 'string',
                              'values': [
                                  'string',
                              ]
                          },
                          'like': {
                              'columnName': 'string',
                              'value': 'string'
                          },
                          'notLike': {
                              'columnName': 'string',
                              'value': 'string'
                          }
                      },
                      'and': [
                          {'... recursive ...'},
                      ],
                      'or': [
                          {'... recursive ...'},
                      ]
                  },
                  'sensitive': True|False
              }
          },
          'createdAt': datetime(2015, 1, 1),
          'errorMessage': 'string',
          'effectiveColumnNames': [
              'string',
          ],
          'effectiveRowFilter': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **id** *(string) --* 

        The ID of the asset filter.

        
      

      - **domainId** *(string) --* 

        The ID of the domain where the asset filter is created.

        
      

      - **assetId** *(string) --* 

        The ID of the asset.

        
      

      - **name** *(string) --* 

        The name of the asset filter.

        
      

      - **description** *(string) --* 

        The description of the asset filter.

        
      

      - **status** *(string) --* 

        The status of the asset filter.

        
      

      - **configuration** *(dict) --* 

        The configuration of the asset filter.

        .. note::    This is a Tagged Union structure. Only one of the     following top level keys will be set: ``columnConfiguration``, ``rowConfiguration``.     If a client receives an unknown member it will     set ``SDK_UNKNOWN_MEMBER`` as the top level key,     which maps to the name or tag of the unknown     member. The structure of ``SDK_UNKNOWN_MEMBER`` is     as follows::

                'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}


      
        

        - **columnConfiguration** *(dict) --* 

          The column configuration of the asset filter.

          
          

          - **includedColumnNames** *(list) --* 

            Specifies whether to include column names.

            
            

            - *(string) --* 
        
      
        

        - **rowConfiguration** *(dict) --* 

          The row configuration of the asset filter.

          
          

          - **rowFilter** *(dict) --* 

            The row filter.

            .. note::    This is a Tagged Union structure. Only one of the     following top level keys will be set: ``expression``, ``and``, ``or``.     If a client receives an unknown member it will     set ``SDK_UNKNOWN_MEMBER`` as the top level key,     which maps to the name or tag of the unknown     member. The structure of ``SDK_UNKNOWN_MEMBER`` is     as follows::

                        'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}


          
            

            - **expression** *(dict) --* 

              The expression of the row filter.

              .. note::    This is a Tagged Union structure. Only one of the     following top level keys will be set: ``equalTo``, ``notEqualTo``, ``greaterThan``, ``lessThan``, ``greaterThanOrEqualTo``, ``lessThanOrEqualTo``, ``isNull``, ``isNotNull``, ``in``, ``notIn``, ``like``, ``notLike``.     If a client receives an unknown member it will     set ``SDK_UNKNOWN_MEMBER`` as the top level key,     which maps to the name or tag of the unknown     member. The structure of ``SDK_UNKNOWN_MEMBER`` is     as follows::

                            'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}


            
              

              - **equalTo** *(dict) --* 

                The 'equal to' clause of the row filter expression.

                
                

                - **columnName** *(string) --* 

                  The name of the column.

                  
                

                - **value** *(string) --* 

                  The value that might be equal to an expression.

                  
            
              

              - **notEqualTo** *(dict) --* 

                The 'no equal to' clause of the row filter expression.

                
                

                - **columnName** *(string) --* 

                  The name of the column.

                  
                

                - **value** *(string) --* 

                  The value that might not be equal to the expression.

                  
            
              

              - **greaterThan** *(dict) --* 

                The 'greater than' clause of the row filter expression.

                
                

                - **columnName** *(string) --* 

                  The name of the column.

                  
                

                - **value** *(string) --* 

                  The value that might be greater than an expression.

                  
            
              

              - **lessThan** *(dict) --* 

                The 'less than' clause of the row filter expression.

                
                

                - **columnName** *(string) --* 

                  The name of the column.

                  
                

                - **value** *(string) --* 

                  The value that might be less than the expression.

                  
            
              

              - **greaterThanOrEqualTo** *(dict) --* 

                The 'greater than or equal to' clause of the filter expression.

                
                

                - **columnName** *(string) --* 

                  The name of the column.

                  
                

                - **value** *(string) --* 

                  The value that might be greater than or equal to an expression.

                  
            
              

              - **lessThanOrEqualTo** *(dict) --* 

                The 'less than or equal to' clause of the row filter expression.

                
                

                - **columnName** *(string) --* 

                  The name of the column.

                  
                

                - **value** *(string) --* 

                  The value that might be less than or equal to an expression.

                  
            
              

              - **isNull** *(dict) --* 

                The 'is null' clause of the row filter expression.

                
                

                - **columnName** *(string) --* 

                  The name of the column.

                  
            
              

              - **isNotNull** *(dict) --* 

                The 'is not null' clause of the row filter expression.

                
                

                - **columnName** *(string) --* 

                  The name of the column.

                  
            
              

              - **in** *(dict) --* 

                The 'in' clause of the row filter expression.

                
                

                - **columnName** *(string) --* 

                  The name of the column.

                  
                

                - **values** *(list) --* 

                  The values that might be in the expression.

                  
                  

                  - *(string) --* 
              
            
              

              - **notIn** *(dict) --* 

                The 'not in' clause of the row filter expression.

                
                

                - **columnName** *(string) --* 

                  The name of the column.

                  
                

                - **values** *(list) --* 

                  The value that might not be in the expression.

                  
                  

                  - *(string) --* 
              
            
              

              - **like** *(dict) --* 

                The 'like' clause of the row filter expression.

                
                

                - **columnName** *(string) --* 

                  The name of the column.

                  
                

                - **value** *(string) --* 

                  The value that might be like the expression.

                  
            
              

              - **notLike** *(dict) --* 

                The 'not like' clause of the row filter expression.

                
                

                - **columnName** *(string) --* 

                  The name of the column.

                  
                

                - **value** *(string) --* 

                  The value that might not be like the expression.

                  
            
          
            

            - **and** *(list) --* 

              The 'and' clause of the row filter.

              
              

              - *(dict) --* 

                The row filter.

                .. note::    This is a Tagged Union structure. Only one of the     following top level keys will be set: ``expression``, ``and``, ``or``.     If a client receives an unknown member it will     set ``SDK_UNKNOWN_MEMBER`` as the top level key,     which maps to the name or tag of the unknown     member. The structure of ``SDK_UNKNOWN_MEMBER`` is     as follows::

                                'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}


              
          
            

            - **or** *(list) --* 

              The 'or' clause of the row filter.

              
              

              - *(dict) --* 

                The row filter.

                .. note::    This is a Tagged Union structure. Only one of the     following top level keys will be set: ``expression``, ``and``, ``or``.     If a client receives an unknown member it will     set ``SDK_UNKNOWN_MEMBER`` as the top level key,     which maps to the name or tag of the unknown     member. The structure of ``SDK_UNKNOWN_MEMBER`` is     as follows::

                                'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}


              
          
        
          

          - **sensitive** *(boolean) --* 

            Specifies whether the row filter is sensitive.

            
      
    
      

      - **createdAt** *(datetime) --* 

        The timestamp at which the asset filter was created.

        
      

      - **errorMessage** *(string) --* 

        The error message that is displayed if the asset filter is not created successfully.

        
      

      - **effectiveColumnNames** *(list) --* 

        The column names in the asset filter.

        
        

        - *(string) --* 
    
      

      - **effectiveRowFilter** *(string) --* 

        The row filter in the asset filter.

        
  
  **Exceptions**
  
  *   :py:class:`DataZone.Client.exceptions.InternalServerException`

  
  *   :py:class:`DataZone.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`DataZone.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`DataZone.Client.exceptions.ThrottlingException`

  
  *   :py:class:`DataZone.Client.exceptions.ServiceQuotaExceededException`

  
  *   :py:class:`DataZone.Client.exceptions.ConflictException`

  
  *   :py:class:`DataZone.Client.exceptions.ValidationException`

  
  *   :py:class:`DataZone.Client.exceptions.UnauthorizedException`

  