I was just in the process of moving one of the apps from Dash 0.42 to 0.43 and it looks like I also grabbed Dash Table 3.7.0 ( which I don’t think has a release announcement yet )
It looks like conditioning formatting has changed (judging by how my app has broken) but the documentation isn’t updated yet. Say I have a conditional formatting that looks like this where “Status” and “At_Check” are fields:
You can’t use both the .format() method and f-strings together, pick one or the other. I.e. do:
f'{{{x}}} < 0.9'
Or:
'{{{}}} < 0.9'.format(x)
It’s up to you but f-strings are the current Pythonic way to implement string substitution as they are both more compact and easier to read. But they only work in Python 3.6+.
style_data_conditional =
# Colour red when values are less than benchmark
[
{
'if': {
'column_id': str(column),
#'filter_query': f'{{{column}}} < {{{benchmark}}}'},
'filter_query': f'{{{Fruits}}} eq "Apples" && {{{column}}} <
{{{benchmark}}}'},
},
'backgroundColor': 'red',
'color': 'white'
} for column in data.iloc[:,0:].columns
benchmark stores a dropdown selection which will be a column name. The first column of the dataset is Fruits and it won’t be in the list of options in the dropdown. I am having a problem with this f-string.