TLDR: The native filter should match the column data type and not attempt to interpret the input as a different data type.
In my application I use a DataTable with a column containing long ids as strings. When filtering for certain ids with the native filter method of the DashTable the expected results are not found. I tracked down the bug to the issue below:
The minimalistic example above contains one dash DataTable containing a DataFrame with one column ‘long_ids’ and two string entries ‘8672633670679492129’ and ‘8672633670679493000’.
The DataTable uses native filtering. Now, when I enter input into the filter the following behaviour occurs:
Filter_Input -> Table Output (which entries are shown)
8672633670679492129 -> 8672633670679493000 #Note: The expected result 8672633670679492129 is missing here!
867263367067949212 -> neither
86726336706794921 -> 8672633670679493000
8672633670679492 -> 8672633670679492129
867263367067949 -> both
The first three cases should correctly show 8672633670679492129 as the only result.
Probable cause:
8672633670679493000 ist the int64 conversion of 8672633670679492129. I suspect, that somewhere the filter input gets converted to int64 whereby the last digits are lost. However, the filter should respect the column type ‘text’ and not attempt to interpret the input as a number.
Context:
macOS Catalina Version 10.15.07
Tested in both:
Firefox 83.0
Safari Version 14.0 (15610.1.28.1.9, 15610)
Description
TLDR: The native filter should match the column data type and not attempt to interpret the input as a different data type.
In my application I use a DataTable with a column containing long ids as strings. When filtering for certain ids with the native filter method of the DashTable the expected results are not found. I tracked down the bug to the issue below:
The minimalistic example above contains one dash DataTable containing a DataFrame with one column ‘long_ids’ and two string entries ‘8672633670679492129’ and ‘8672633670679493000’. The DataTable uses native filtering. Now, when I enter input into the filter the following behaviour occurs:
Filter_Input -> Table Output (which entries are shown)
8672633670679492129 -> 8672633670679493000 #Note: The expected result 8672633670679492129 is missing here! 867263367067949212 -> neither 86726336706794921 -> 8672633670679493000 8672633670679492 -> 8672633670679492129 867263367067949 -> both
‘8672633670679492129’ (with quotations marks) -> 8672633670679492129
Expected Behaviour:
The first three cases should correctly show 8672633670679492129 as the only result.
Probable cause:
8672633670679493000 ist the int64 conversion of 8672633670679492129. I suspect, that somewhere the filter input gets converted to int64 whereby the last digits are lost. However, the filter should respect the column type ‘text’ and not attempt to interpret the input as a number.
Context:
macOS Catalina Version 10.15.07
Tested in both: Firefox 83.0 Safari Version 14.0 (15610.1.28.1.9, 15610)
dash 1.17.0 dash-core-components 1.13.0 dash-html-components 1.1.1 dash-renderer 1.8.3 dash-table 4.11.0