dtale icon indicating copy to clipboard operation
dtale copied to clipboard

Save custom filters/user settings & preferences

Open fredzannarbor opened this issue 3 years ago • 5 comments

It doesn't look like there is a way to save custom filters? That would be a useful feature. My use case is for authors who frequently look at data that is in the same format every time, but typically has been updated with the addition of some new data. A lot of the time they want to answer the same question -- "how many units have I sold in market X" or whatever.

More broadly, it doesn't seem there is a concept of per-user preferences or settings? That would be a valuable feature for people who are deploying this to diverse communities. Integrating with the flask user model would work fine for me/be a good start.

fredzannarbor avatar May 22 '21 21:05 fredzannarbor

So these features, while very useful, would require some sort of data storage mechanism to come pre-packaged with the software. Without something like that there would be nowhere to store information like that. Same goes for the user-based information, we would need to be able to store that information somewhere.

The best option I could offer is to allow you to save custom filters (meaning filters entered using the "Custom Filter" popup) w/ a custom name but it would be stored in the memory of your running D-Tale process. So the downside to doing this is that if your D-Tale process gets killed your saved custom filters would go away. One way to remedy that issue is to change your global state mechanism to use something like Redis instead of memory (here's some docs on how). I'm not 100% sure that using global state will allow you to persist filters after restarts of your global app (if not I could add that pretty easily).

The other option is to use the "Predefined Filters" functionality. That should be pretty full-proof since it would be part of your startup script. But maybe i'm not understanding the problem fully.

aschonfeld avatar May 29 '21 19:05 aschonfeld

Well, yes. I think "we" should bite the bullet and add a user database. Ideally SQLlite and compatible with Flask & Django.

The reason is inherent in dTale's nature: it is by design a super powerful interface for exploring complex data. Simply put, almost every time I use dTale as a data browser, I am doing a new calculation that is complex and that I may want to do again in the future. Recreating these calculations every time is inherently tiresome.

I might be able to help with some portions of this effort. I think I know most of what we'd need to do, with the exception of the more complex aspects of how dTale manages its state, multiple instances/etc.

fredzannarbor avatar May 29 '21 20:05 fredzannarbor

Please, by all means, make a fork and see how far you can get with it. If you get far enough i can look into making it an optional dependency.

aschonfeld avatar May 29 '21 20:05 aschonfeld

I'll give it a whirl!

fredzannarbor avatar May 29 '21 20:05 fredzannarbor

That would be awesome, thank you!

aschonfeld avatar May 29 '21 21:05 aschonfeld