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
Auto complete columns #95
Conversation
as a side note, you can't run |
This wont work until a full custom completer is built. That would be a major project. I'll have to let that simmer for a while to see how I could even implement this. The reason is that:
Also, as to why the country names are not showing up: cardinality is 187, but I've set in constants.py:
I've pushed some code to detect categoricals. If you load a parquet file with country as categorical, or set it in the notebook before starting pandasgui, it'll work and find the country names. I could also bump the constant to 200, but how much is enough? Might hit a case with 201. or 300. Didn't want to bog down too much the suggestion speed, so there is a tradeoff here. Also fixed a few bugs that were eating spaces etc.
Yep, that now works, I switched the split to regex to include both backtick and double quote matches. Unfortunately, this doesn't support unicode at the moment, since pandas doesn't handle them in column names with numexpr (it does in all other features). I'll have to think about how to handle this. PR against Pandas is probably unlikely to get merged anytime soon... I think the current state is usable, let me know what you think. |
Yeah thanks. We can improve this heuristic later.
Still doesn't work for me. To clarify what I meant, when you have a backticked column name already in the text it won't suggest more column names if you type a third backtick. Like when someone types this it should suggest more column names
Sure I'll merge, the improvements can be added if you have time. |
you have to have a space before the backtick or the double quote for this to trigger again. That's how the |
Or comma, if you do a |
Purpose
Adding autocompletion to the filter QLineEdit widgets. This is to get feedback. I would think this is better than copy / paste or drag and drop, maybe? If this works ok, I'd like to expand and do proper filtering of valid values based on column in a future PR.
This doesn't really close #88 as I think the column header filtering is probably what a lot of people really want, but that is too much of time budget for me ATM.
Added:
constant for max cardinality of categoricals to be included in autocompletion (should be a user setting...)
checkbox below the filter box to enable/disable autocompletion
QCompleter based on a list of columns (backtick delimited) and values for low cardinality categoricals (quote delimited)
case insensitive suggestions
start with backtick to get list of columns only
type the numexpr as usual, ie ==, in (), !=, then to select an available value, use quote (")