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 duration type #431

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

Implement filtering options for duration type #431

kgodey opened this issue Jul 18, 2021 · 3 comments · Fixed by #1089
Assignees
Labels
ready Ready for implementation 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 duration types support the following filters via API:
    • between {x} and {y}
    • equals {x}
    • does not equal {x}
    • greater than {x}
    • less than {x}
    • greater than or equals {x}
    • less than or equals {x}
    • is empty
    • is not empty
  • We need to also ensure that values of the filters don't have to be a number. We should accept natural language like "an hour", or "2 days".

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

Marking as blocked until #385 and #430 are complete.

@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
@mathemancer
Copy link
Contributor

mathemancer commented Jul 19, 2021

Similarly to #426, I think there are advantages to using the native PostgreSQL parsing for the human-friendly duration strings, and it's already quite sophisticated and complete.

@kgodey
Copy link
Contributor Author

kgodey commented Mar 10, 2022

Reopening this since it was on @dmos62's standup today.

@dmos62
Copy link
Contributor

dmos62 commented Mar 11, 2022

Closing. I double checked and the linked PR indeed makes sure that the interval DB type is supported, also the duration UI type is properly declared where appropriate in the filters endpoint. Sorry for the confusion.

@dmos62 dmos62 closed this as completed Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready Ready for implementation 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.

4 participants