SavingFrame opened a new pull request, #52748:
URL: https://github.com/apache/airflow/pull/52748

   Hello everyone!
   
   This PR adds a new DAG calendar view endpoint that provides scheduling 
information in a calendar format. This endpoint returns the calendar that 
existed in Airflow 2.x but provides additional functionality. The new endpoint 
includes filtering by `logical_date` and the ability to choose granularity, 
allowing users to customize their calendar view based on specific time periods 
and detail levels.
   
   ## Changes in this PR:
   - Create service file that processes historical DagRuns and presumes queued 
runs
   - Add UI endpoint
   - Update Swagger documentation
   - Add tests for different options of this endpoint
   
   ## How was this patch tested?
   
   - Added comprehensive unit tests for the calendar endpoint
   - Tests cover various scenarios including date filtering, granularity 
options, and DAG selection
   - All existing tests continue to pass
   - Static code checks and pre-commit hooks pass
   
   ## API Details
   
   **Endpoint:** `GET /ui/calendar/{dag_id}`
   
   **Path Parameters:**
   - `dag_id` (string, required): The DAG ID
   
   **Query Parameters:**
   - `granularity` (string, optional): Time granularity - `"hourly"` or 
`"daily"` (default: `"daily"`)
   - `logical_date_gte` (datetime, optional): Start date for filtering (ISO 
8601 format)
   - `logical_date_lte` (datetime, optional): End date for filtering (ISO 8601 
format)
   
   **Response Format:**
   Returns an array of `CalendarTimeRangeResult` objects with the following 
structure:
   
   ```json
   [
     {
       "datetime": "2024-01-15 00:00:00",
       "state": "success",
       "count": 5
     },
     {
       "datetime": "2024-01-15 00:00:00",
       "state": "running",
       "count": 2
     },
     {
       "datetime": "2024-01-16 00:00:00",
       "state": "planned",
       "count": 7
     }
   ]
   ```
   
   **Response Fields:**
   - `datetime`: The timestamp for the calendar entry
   - `state`: Task state - one of `"queued"`, `"running"`, `"success"`, 
`"failed"`, or `"planned"`
   - `count`: Number of task instances in this state at the given time
   
   ## Related Links
   - 
[[Discussion](https://github.com/apache/airflow/discussions/50907)](https://github.com/apache/airflow/discussions/50907)
   - [[Reference 
PR](https://github.com/apache/airflow/pull/37988)](https://github.com/apache/airflow/pull/37988)
 that provided the main logic
   - [[Specific 
changes](https://github.com/apache/airflow/pull/37988/files#diff-917b70d2661fae8322c538a4f60b9d4ba755556036fe0c527eb0411a6ac60f2eL2841)](https://github.com/apache/airflow/pull/37988/files#diff-917b70d2661fae8322c538a4f60b9d4ba755556036fe0c527eb0411a6ac60f2eL2841)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to