Christoph Wiese

    Christoph Wiese

    1 year ago
    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")
    ?
    Kevin Kho

    Kevin Kho

    1 year ago
    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.
    Christoph Wiese

    Christoph Wiese

    1 year ago
    Thanks for looking into it! Does that mean changing the date in the context would cover the CronSchedule as well?
    Kevin Kho

    Kevin Kho

    1 year ago
    I’ll give a hesitant yes until I can confirm with Michael who made the PR. Will definitely circle back here
    Michael Adkins

    Michael Adkins

    1 year ago
    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.
    Christoph Wiese

    Christoph Wiese

    1 year ago
    Hi @Michael Adkins 👋🏻 - 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?
    Michael Adkins

    Michael Adkins

    1 year ago
    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
    Christoph Wiese

    Christoph Wiese

    1 year ago
    got it, thanks 🙂