Skip to content

Conversation

fiedlerNr9
Copy link
Contributor

@fiedlerNr9 fiedlerNr9 commented Oct 10, 2025

  • Introduce timezones for cron triggers
custom_trigger = flyte.Trigger(
    "custom_cron",
    flyte.Cron("0 0 * * *", timezone="Europe/London"),  # Runs once every day at midnight London time
    inputs={"start_time": flyte.TriggerTime, "x": 1},
)


@property
def timezone_expression(self) -> str:
return f"{self.timezone} {self.expression}"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it must be

Suggested change
return f"{self.timezone} {self.expression}"
return f"CRON_TZ={self.timezone} {self.expression}"

for example:
CRON_TZ=America/Chicago * * * * *

"""

expression: str
timezone: Literal["America/Los_Angeles", "Europe/London", "Australia/Sydney", "America/New_York"] = DEFAULT_TIMEZONE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why these 4?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be extended to all the timezones


import rich.repr

DEFAULT_TIMEZONE = "America/Los_Angeles"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be utc - no time zone to preserve current behavior

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah easy to default to UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants