Skip to content

feat: Search within date range in pipeline run API#130

Open
yuechao-qin wants to merge 1 commit intoycq/search-pipeline-run-namefrom
ycq/search-pipeline-run-date-range
Open

feat: Search within date range in pipeline run API#130
yuechao-qin wants to merge 1 commit intoycq/search-pipeline-run-namefrom
ycq/search-pipeline-run-date-range

Conversation

@yuechao-qin
Copy link
Collaborator

@yuechao-qin yuechao-qin commented Feb 26, 2026

TL;DR

Implemented search within date range in Pipeline Runs.

What changed?

Functional

  • API GET /api/pipeline_runs/
    • Search by date range in filter_query. Example query (not URL encoded for example):
        /api?filter_query={
          "and": [{
            "time_range": {
              "key": "system/pipeline_run.date.created_at",
              "start_time": "2024-01-01T00:00:00Z",
              "end_time": "2024-02-01T00:00:00Z"
            }
          }]
        }
      

Other

  • Added timezone handling to convert aware datetimes to naive UTC for database compatibility (i.e. date range search will convert API timezone to UTC because DB datetime is only UTC)

How to test?

uv run pytest tests/test_api_server_sql.py tests/test_filter_query_sql.py

The implementation includes comprehensive tests covering:

  • Basic time range filtering with start and end times
  • Start-only time ranges (no end time)
  • Boundary conditions (inclusive start, exclusive end)
  • Timezone offset handling (e.g., +05:30 converted to UTC)
  • Negation with NOT operator
  • Combination with annotation-based filters
  • Nested logical operations (AND/OR)
  • Multiple time ranges in the same query

Why make this change?

  • This change enables users to filter pipeline runs by creation date range.
  • The implementation properly handles timezone conversions to ensure consistent behavior across different client timezones while maintaining compatibility with the database's naive UTC storage format.

@yuechao-qin yuechao-qin marked this pull request as ready for review February 26, 2026 14:57
@yuechao-qin yuechao-qin requested a review from Ark-kun as a code owner February 26, 2026 14:57
@yuechao-qin yuechao-qin force-pushed the ycq/search-pipeline-run-name branch from f8b3f75 to 7a7a60b Compare February 27, 2026 21:55
@yuechao-qin yuechao-qin force-pushed the ycq/search-pipeline-run-date-range branch from 1f4e7d9 to 300d652 Compare February 27, 2026 21:55
@yuechao-qin yuechao-qin changed the base branch from ycq/search-pipeline-run-name to graphite-base/130 February 28, 2026 10:25
@yuechao-qin yuechao-qin force-pushed the ycq/search-pipeline-run-date-range branch from 300d652 to 67941dd Compare February 28, 2026 10:25
@yuechao-qin yuechao-qin changed the base branch from graphite-base/130 to ycq/search-pipeline-run-name February 28, 2026 10:26
@yuechao-qin yuechao-qin changed the base branch from ycq/search-pipeline-run-name to graphite-base/130 March 1, 2026 03:23
@yuechao-qin yuechao-qin force-pushed the ycq/search-pipeline-run-date-range branch from 67941dd to 0c95a90 Compare March 1, 2026 03:23
@yuechao-qin yuechao-qin changed the base branch from graphite-base/130 to ycq/search-pipeline-run-name March 1, 2026 03:23
@yuechao-qin yuechao-qin force-pushed the ycq/search-pipeline-run-date-range branch from 0c95a90 to c4afbec Compare March 2, 2026 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant