manisnitt commented on issue #60072:
URL: https://github.com/apache/airflow/issues/60072#issuecomment-3707110569
Thanks @tirkarthi ,
It is working after changing the schedule type. In case anyone wants to see
how I did this then you can follow below DAG.
`from datetime import datetime
from airflow.sdk import dag, task
from airflow.sdk import get_current_context
from airflow.timetables.interval import CronDataIntervalTimetable
import pendulum
@dag(
start_date=datetime(2025, 12, 31),
schedule=CronDataIntervalTimetable(cron="@daily",
timezone=pendulum.timezone("Asia/Kolkata")),
# schedule="@daily",
catchup=True,
is_paused_upon_creation=False,
)
def print_execution_dates_v2():
@task
def print_actual_interval():
context = get_current_context()
start = context["data_interval_start"]
end = context["data_interval_end"]
dag_run = context["dag_run"]
logical = dag_run.logical_date
run_after = dag_run.run_after
print(f"Period Start: {start}")
print(f"Period End: {end}")
print(f"Logical Date: {logical}")
print(f"Run After: {run_after}")
@task
def debug_timetable():
context = get_current_context()
dag = context["dag"]
print(type(dag.timetable))
print_actual_interval() >> debug_timetable()
print_execution_dates_v2()
`
--
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]