i`m having this issue and i`m not sure if it`s a p...
# ask-community
l
i`m having this issue and i`m not sure if it`s a problem with the prefect cloud UI or with my code. I`m trying to schedule the flow to run daily at a specific hour but when i`m adding filters to the schedule the UI doesn`t show upcoming runs anymore. I was trying to set the filters alternatively with the option below. did anybody else had this issue? prefect version 0.15.9
Copy code
schedule = Schedule(
        clocks=[clocks.IntervalClock(timedelta(days=1))],
        # filters=[filters.at_time(time(10))],
        or_filters=[filters.between_times(pendulum.time(9), pendulum.time(9))]
    )
a
@Lucian Rosu Your filter is a bit too aggressive 😄 it filters out everything. You set it to allow to run between 9 and 9, which means never. I think the easiest way to debug this is to print the next schedules. Here is an example of an hourly clock for which filter ensures that only hours between 9 am and 5 pm are used:
Copy code
from datetime import timedelta
import pendulum
from prefect.schedules import Schedule
from prefect.schedules.clocks import IntervalClock
from prefect.schedules.filters import at_time, between_times

clock = IntervalClock(
    start_date=pendulum.datetime(2021, 12, 17, 9, 0, tz="America/New_York"),
    interval=timedelta(hours=1),
)
schedule = Schedule(clocks=[clock],
                    or_filters=[between_times(pendulum.time(9), pendulum.time(17))]
)
for sched in schedule.next(20):
    print(sched)
Output:
Copy code
2021-12-17T09:00:00-05:00
2021-12-17T10:00:00-05:00
2021-12-17T11:00:00-05:00
2021-12-17T12:00:00-05:00
2021-12-17T13:00:00-05:00
2021-12-17T14:00:00-05:00
2021-12-17T15:00:00-05:00
2021-12-17T16:00:00-05:00
2021-12-17T17:00:00-05:00
2021-12-18T09:00:00-05:00
2021-12-18T10:00:00-05:00
2021-12-18T11:00:00-05:00
2021-12-18T12:00:00-05:00
2021-12-18T13:00:00-05:00
2021-12-18T14:00:00-05:00
2021-12-18T15:00:00-05:00
2021-12-18T16:00:00-05:00
2021-12-18T17:00:00-05:00
2021-12-19T09:00:00-05:00
2021-12-19T10:00:00-05:00
l
Thanks @Anna Geller . I had missed the scheduler debug feature when browsing the docs. managed to make it work, i was looking for something among these line:
Copy code
clock = clocks.IntervalClock(
        start_date=pendulum.yesterday(tz='Europe/Bucharest'),
        interval=timedelta(hours=1),
    )
    
    schedule = Schedule(
        clocks=[clock],
        filters=[filters.at_time(pendulum.time(10))],
    )
🙌 1