-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Add DAG calendar view endpoint #52748
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
Conversation
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
|
3e46032
to
6e8c482
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks for the pull request.
A few suggestions
airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/calendar.py
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/api_fastapi/core_api/routes/ui/calendar.py
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/calendar.py
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/calendar.py
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/api_fastapi/core_api/services/ui/calendar.py
Outdated
Show resolved
Hide resolved
7f1a613
to
8de7b93
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of Nit.
Thanks for the PR, I think it's a good start to iterate on. Since it's a UI endpoint we are free to modify this as we see fit.
airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/calendar.py
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/calendar.py
Outdated
Show resolved
Hide resolved
Implement calendar view functionality that provides DAG scheduling information in a calendar format. The endpoint allows users to visualize DAG schedules and execution patterns over time, improving workflow management and scheduling oversight. In case if you want get get data for several days you can use daily granularity.
Change calendar endpoint to return structured response with total count and dag runs array instead of flat list for better API consistency.
Update calendar API to return consistent ISO 8601 datetime format with UTC timezone suffix across all database dialects and remove timezone stripping.
…lendar.py Co-authored-by: Pierre Jeambrun <[email protected]>
…lendar.py Co-authored-by: Pierre Jeambrun <[email protected]>
de47b0e
to
6841975
Compare
Thank you. Everything is fixed. |
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
#protm |
Great work! As I said in another thread, I love the hourly or daily granularity. I'm excited to make both a monthly and a weekly calendar view. |
* Add DAG calendar view endpoint Implement calendar view functionality that provides DAG scheduling information in a calendar format. The endpoint allows users to visualize DAG schedules and execution patterns over time, improving workflow management and scheduling oversight. In case if you want get get data for several days you can use daily granularity. * restructure calendar response format Change calendar endpoint to return structured response with total count and dag runs array instead of flat list for better API consistency. * Update swagger documentation * standardize calendar datetime format to ISO 8601 with UTC Update calendar API to return consistent ISO 8601 datetime format with UTC timezone suffix across all database dialects and remove timezone stripping. * Update airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/calendar.py Co-authored-by: Pierre Jeambrun <[email protected]> * Update airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/calendar.py Co-authored-by: Pierre Jeambrun <[email protected]> * Rename pydantic models --------- Co-authored-by: Pierre Jeambrun <[email protected]>
* Add DAG calendar view endpoint Implement calendar view functionality that provides DAG scheduling information in a calendar format. The endpoint allows users to visualize DAG schedules and execution patterns over time, improving workflow management and scheduling oversight. In case if you want get get data for several days you can use daily granularity. * restructure calendar response format Change calendar endpoint to return structured response with total count and dag runs array instead of flat list for better API consistency. * Update swagger documentation * standardize calendar datetime format to ISO 8601 with UTC Update calendar API to return consistent ISO 8601 datetime format with UTC timezone suffix across all database dialects and remove timezone stripping. * Update airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/calendar.py Co-authored-by: Pierre Jeambrun <[email protected]> * Update airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/calendar.py Co-authored-by: Pierre Jeambrun <[email protected]> * Rename pydantic models --------- Co-authored-by: Pierre Jeambrun <[email protected]>
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:
How was this patch tested?
API Details
Endpoint:
GET /ui/calendar/{dag_id}
Path Parameters:
dag_id
(string, required): The DAG IDQuery 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:Response Fields:
datetime
: The timestamp for the calendar entrystate
: Task state - one of"queued"
,"running"
,"success"
,"failed"
, or"planned"
count
: Number of task instances in this state at the given timeRelated Links