Skip to content
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

Implement filtering options for date & time types #427

Closed
Tracked by #250
kgodey opened this issue Jul 18, 2021 · 3 comments · Fixed by #1089
Closed
Tracked by #250

Implement filtering options for date & time types #427

kgodey opened this issue Jul 18, 2021 · 3 comments · Fixed by #1089
Assignees
Labels
type: enhancement New feature or request work: backend Related to Python, Django, and simple SQL

Comments

@kgodey
Copy link
Contributor

kgodey commented Jul 18, 2021

Problem

  • We need to ensure that records that include columns of all Date & Time types support the following filters via API:
    • between {x} and {y}
    • is {x}
    • is not {x}
    • before {x}
    • after {x}
    • on or before {x}
    • or or after {x}
    • is empty
    • is not empty
  • We need to also ensure that values of the filters don't have to be an exact date. We should accept natural language like "next month", or "tomorrow".

This involves:

  • Implementing the filters in the backend
  • Updating the /api/v0/databases/<id>/types/ endpoint to store available filters on this type
    • Filter information should include the number of parameters needing to be passed in (e.g. between needs 2 parameters, is empty needs 0)

Additional context

@kgodey kgodey added needs: unblocking Blocked by other work type: enhancement New feature or request work: backend Related to Python, Django, and simple SQL work: database labels Jul 18, 2021
@kgodey kgodey added this to the 07. Initial Data Types milestone Jul 18, 2021
@kgodey kgodey added ready Ready for implementation and removed needs: unblocking Blocked by other work labels Feb 4, 2022
@dmos62 dmos62 mentioned this issue Feb 21, 2022
7 tasks
@dmos62
Copy link
Contributor

dmos62 commented Feb 22, 2022

A brief survey on Matrix suggests that we don't need time x is before time y phrasing and can do with time x is lesser than time y. This simplifies implementation, since under-the-hood we're using a simple x < y comparison. An alternative would have been to make up a mechanism for providing filter name aliases for when parameters match some pattern (like them being time-like).

@kgodey
Copy link
Contributor Author

kgodey commented Feb 22, 2022

Since the conversation in that Matrix channel has moved on, I'll comment here.

@dmos62 I think "21 January is less than 4 February" is not as intuitive for non-technical users, people don't regularly say that in English. I'd like to stick to the original phrasing.

@dmos62
Copy link
Contributor

dmos62 commented Feb 22, 2022

Ok, I'll set up filter name aliases in a dedicated PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request work: backend Related to Python, Django, and simple SQL
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants