Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Unable to use Predefined-Filters #711

Closed
zinka opened this issue Nov 18, 2022 · 2 comments
Closed

Unable to use Predefined-Filters #711

zinka opened this issue Nov 18, 2022 · 2 comments

Comments

@zinka
Copy link

zinka commented Nov 18, 2022

Hi,

First of all, thank you very much for providing us with a great tool like Dtale. I have been using "predefined-filters" feature with older versions of Dtale. However, after upgrading to 2.9.0, I am unable to use this feature. When I click on predefined-filters in the left side menu-bar, I am going to blank page! Am I doing something wrong? Following is a simple code I am using:

import dtale.predefined_filters as predefined_filters
predefined_filters.set_filters([
{
"name": "Name",
"column": "SBP",
"description": "SBP Active",
"handler": lambda df, val: df[(df["SBP"] == val) & (df["SBP"] > 2)],
"input_type": "input",
"default": 1,
"active": True
}
])

@aschonfeld
Copy link
Collaborator

@zinka I have figured out the issue with this filter (great catch BTW). It was returning any value entered thru the frontend ton the backend as a string. I have updated the frontend to correctly return numbers for integer or float columns. But as a workaround until I can release a new version please update your code to the following:

import dtale.predefined_filters as predefined_filters
predefined_filters.set_filters([
{
"name": "Name",
"column": "SBP",
"description": "SBP Active",
"handler": lambda df, val: df[(df["SBP"] == int(val)) & (df["SBP"] > 2)],
"input_type": "input",
"default": 1,
"active": True
}
])

@aschonfeld
Copy link
Collaborator

@zinka just released v2.9.1 to pypi (will be on conda-forge shortly). Let me know if this update worked for you. Also, if you haven't already, please toss your ⭐ on the repo when you get a sec. Thanks 🙏

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants