-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable filtering on async tables #26
Comments
I didn't actually think much on that yet :)
Seems like it should be fairly easy to implement filtering with that, but I'm not sure if sorting is equally easy (because of performance). If there's anything I can help with, feel free to ask! |
You could probably even just use |
Enables default ag-grid style filtering on async tables by creating a filter function from filterModel data.
Added a pull request for consideration. The PR as coded is pretty clear since it translates filterModel into Julia code that is parsed and evaluated. MetaProgramming suggestions are welcome if there is good reason to do this differently. Had to use invokelatest in order to get this to work. The default text filter behavior is a bit annoying in that it lowercases the filter string, so ended up using regular expression matching with ignore case. For async tables enabled "Clear filter" and "Apply filter" so that the user controls when the filtering starts. The Base.Iterators.filter on rows should work, but have only tested with a DataFrame so far. If there are cases where we need to call Tables.datavaluerows please advise. Also looking for hints on what to do about rowCount. The current behavior of the scrollbar seems tied to the size of the full set of rows without filtering. As filtering can only make the number of rows smaller, perhaps it is okay that one can scroll past the end of the filtered results. Finally, the ag-grid has an issue where for the 2nd condition in a filter the user can apply the filter for "in range" even if some range fields are blank. Instead of complicating the generated code expressions with checks for === nothing, it simply throws exceptions for now. Not sure if any automated tests are possible easily. |
Also, in case anyone is wondering, used getproperty on a constructed Symbol in case the column name has spaces in it. |
Minor adjustment to return the invokelatest wrapped filter on the first use. The world will be ready for the actual function on subsequent uses.
Added code to sanitize column access and partially specified ranges. Optimize dates via preparsing.
Code now handles partially specified ranges by ignoring them. |
Handle column names and search text with quote characters more defensively.
Updated to generate expressions directly rather than parsing a string.
I want to start working on a PR to support this. Adding the issue so I can ask questions.
Believe I understand how to do this from the ag-grid side. Can you comment on any current ideas you have for filtering the data source? Still trying to understand the Julia data landscape completely. Were you thinking of using Query.jl? Or is filtering something I should build directly on Tables.jl abstractions?
The text was updated successfully, but these errors were encountered: