Checked for duplicates
Yes - I've already checked
π§βπ¬ User Persona(s)
Data User, Data Engineer, Planetary Scientist, Automated Systems/CI-CD Pipelines
πͺ Motivation
...so that I can easily find recent data without manually calculating dates, and create time-based queries that work consistently in automated systems.
π Additional Details
Current Behavior:
before() and after() require explicit datetime objects
- No support for relative time expressions like "last 30 days" or "this year"
- Users must manually calculate dates for common time periods
Proposed Solution:
Support string-based date-math syntax (Elasticsearch-inspired):
# Relative time expressions
products.after("now-30d")
products.after("now-1y").before("now")
products.after("now-6M") # 6 months
# Date ranges with slash notation
products.during("2020/2023") # Start of 2020 to end of 2023
products.during("now-1y/now")
# Named periods
products.after("today")
products.during("this-year")
products.during("last-month")
# Backward compatible with datetime objects
products.after(datetime(2020, 1, 1))
Implementation Approach:
- Extend
before() and after() to accept Union[datetime, str]
- Add new
during() method for date ranges
- Implement
_parse_date_math() helper supporting:
- Units: d (days), w (weeks), M (months), y (years)
- Relative: now, today, now-30d, now+1w
- Named: this-year, last-month, etc.
- Maintain backward compatibility with datetime objects
Related:
For Internal Dev Team To Complete
Acceptance Criteria
Given a user wants to query recent data
When I perform products.after("now-30d")
Then I expect products with dates after 30 days ago from current time
βοΈ Engineering Details
To be filled by Engineering Node Team
π I&T
To be filled by Engineering Node Team
Checked for duplicates
Yes - I've already checked
π§βπ¬ User Persona(s)
Data User, Data Engineer, Planetary Scientist, Automated Systems/CI-CD Pipelines
πͺ Motivation
...so that I can easily find recent data without manually calculating dates, and create time-based queries that work consistently in automated systems.
π Additional Details
Current Behavior:
before()andafter()require explicit datetime objectsProposed Solution:
Support string-based date-math syntax (Elasticsearch-inspired):
Implementation Approach:
before()andafter()to acceptUnion[datetime, str]during()method for date ranges_parse_date_math()helper supporting:Related:
For Internal Dev Team To Complete
Acceptance Criteria
Given a user wants to query recent data
When I perform
products.after("now-30d")Then I expect products with dates after 30 days ago from current time
βοΈ Engineering Details
To be filled by Engineering Node Team
π I&T
To be filled by Engineering Node Team