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
InvalidDatetimeFormat error when attempting to filter on a partially-entered date #1890
Comments
Thanks for report. My immediate reaction is that this makes sense, since Is frontend currently able to handle this gracefully?
We don't actually do any parsing of dates ourselves, we just forward them to Postgres. We're not setup to ignore a filter if it causes Postgres to throw. |
Ok in that case I think we should handle the bulk of the fix here in the front end. As such I'm re-labeling this ticket as front end. Modifying the error response on the back end would be nice, but I'd consider that change to be low-priority enough that we can disregard it for now. |
Without having yet looked at any code, my inclination would be to fix this by making the @pavish can you see an easy path forwards to fixing this on the front end? Would you be up for taking this ticket since it's code you've worked on? |
@seancolsen I was imagining that frontend would throw its queries at our |
We decided (after several to-and-fro conversations) that we will not be performing any sort of date validation on the frontend, since we'd want to be able to accept any string that the backend (right now it's postgres) can parse. The DateInput component is built around this. Restricting values to only what the frontend can parse will severely limit the functionality of the component.
We do not know whether the value is incomplete or not, because the component was built to accept any string.
I don't think we can fix this on the frontend with the above case in mind. I'd very much like the solution to come from the backend for handling invalid filters. |
I'm confused by this message. The It's also worth mentioning that when reproducing this issue, the |
😲 I thought we had minimized our response times to milliseconds for all frequently used endpoints; I'm confused. You mean when a user loads the table page, he's having to wait at least 13 seconds to see the records?
I was under the false impression that we have replaced table Either way, I still picture the workflow here being that frontend throws whatever it has at the backend, the backend throws it at Postgres, and we see what sticks. We can't (and don't want to) parse these inputs neither on the frontend nor on the backend. |
@dmos62 no, the records endpoint doesn't always take 13 seconds -- it just takes 13 seconds when reproducing this issue. So if we're going to "throw it at Postgres and see what sticks", we'll need to find a way to do that in a more performant manner. |
I'd say that the performance of records endpoint and how to deal with invalid filter specs are two different problems. Former might be latter's prerequisite though. |
I'm not sure why this issue is categorized as 'frontend'. I believe we need further discussion before we have an action item to perform as part of this issue. I'm marking this as draft. |
Assigned to @seancolsen to drive this forward to a conclusion. |
There was an extended discussion about this on Matrix (which I missed), and we scheduled a call to continue it, so in preparation, and for the record, I'll post my opinion here:
|
Steps to reproduce
Open the table page for table with a Date column, e.g. the "all_data_types" data set.
Add a filter condition specifying the date column to be equal to a date. Then begin entering a date starting with one number.
Expect either to see no results or to see the same results as without the filter condition.
Instead, observe that the
GET
request to the records endpoint responds with an error 500 and the following tracebackTraceback
Notes
search_fuzzy
parameter used by the Record Selector.Implementation
CC @pavish @dmos62 @mathemancer
The text was updated successfully, but these errors were encountered: