Filter Query DashTable for blank

I am trying to filter an empty string in a DataTable with style_data_conditional but I am getting:

unable to evaluate target: syntax tree is invalid for query={SN} = “”

This is my code working for when there is text in the filter:

dash_table.DataTable(
            id='dataTableCleansedData',
            data=displayData.to_dict('records'),
            columns=[{'name': i, 'id': i} for i in displayData.columns],
            page_current=0,
            page_size=PAGE_SIZE,
            style_data_conditional=[
                {
                    'if': 
                    {
                        'column_id': str(x),
                        'filter_query': '{' + x + '} = "I01"'
                    },
                    'backgroundColor': '#3D9970',
                    'color': 'white',
                } 
                for x in displayData.columns.tolist()
            ],
            style_cell_conditional=[
                {
                    'if': {'column_id': x},
                    'textAlign': 'left'
                    
                }
                for x in ['ID No', 'Father\'s Name']
            ],
            
            css=[{
                'selector': '.dash-cell div.dash-cell-value',
                'rule': 'display: inline; white-space: inherit; overflow: hidden; text-overflow: inherit;'
            }],

            style_table={'overflowX': 'scroll'},
        ),

This gives me an out put like this:

How can I get the same output for Benefits Paid cells?

2 Likes