https://prefect.io logo
#prefect-server
Title
# prefect-server
c

Christoph Wiese

04/06/2021, 9:51 AM
I saw in the release notes for 0.14.15 that if I change
date
in the context, dependant context variables will now align accordingly. Does this apply to
CronSchedule()
as well? Currently I’m using
CronSchedule("00 02,12 * * *", start_date=pendulum.now("Europe/Berlin"))
- could I replace this by overriding date in the context? What is actually the best way to override date - in the configuration.toml as
date=pendulum.today("Europe/Berlin")
?
k

Kevin Kho

04/06/2021, 1:42 PM
Hi @Christoph Wiese! I’ll have to double check this but if you want to use pendulum like that, I think it would be better to modify at runtime. Will confirm this.
c

Christoph Wiese

04/06/2021, 1:50 PM
Thanks for looking into it! Does that mean changing the date in the context would cover the CronSchedule as well?
k

Kevin Kho

04/06/2021, 1:56 PM
I’ll give a hesitant yes until I can confirm with Michael who made the PR. Will definitely circle back here
👌🏻 1
z

Zanie

04/06/2021, 2:55 PM
Hey @Christoph Wiese -- can you clarify what you mean by "cover the
CronSchedule
" ? A description of what your use-case here is might help me understand how to answer.
c

Christoph Wiese

04/06/2021, 2:59 PM
Hi @Zanie 👋🏻 - there is a class called CronSchedule for cron type scheduling of flows with server or cloud. By default this will use the time zone of the server/cloud, which in cloud’s case seems to be UTC. The documentation recommends providing a start_date to CronSchedule, in the desired timezone (thats my example above). So what I’m wondering, if I change the date in the context to Europe/Berlin, will the underlying date for CronSchedule be affected as well, or does that class read its default start date from somehwhere else?
z

Zanie

04/06/2021, 3:05 PM
Ah I see. The change that I made just fills other context variables (e.g.
tomorrow
) with values based on the current date in the context. I don't think this will affect your
CronSchedule
object at all, it doesn't look at context values.
The change I made is mostly useful for backfilling by setting the context to a past date
c

Christoph Wiese

04/06/2021, 3:49 PM
got it, thanks 🙂