Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update deployment SDK to use slugs #17043

Merged
merged 2 commits into from
Feb 7, 2025
Merged

Conversation

desertaxle
Copy link
Member

@desertaxle desertaxle commented Feb 7, 2025

Allows the setting of schedule slugs via a prefect.yaml file:

schedules:
    - cron: "* * * * *"
      slug: "my-important-schedule"

or via the Python SDK:

from prefect import flow
from prefect.schedules import Cron

@flow
def say_hello(name: str = "Marvin"):
    print(f"Hello, {name}")
    
if __name__ == "__main__":
    say_hello.serve("frequently", schedule=Cron("* * * * *", slug="my-important-schedule")

Copy link

codspeed-hq bot commented Feb 7, 2025

CodSpeed Performance Report

Merging #17043 will not alter performance

Comparing deployment-schedule-sdk-updates (ea20178) with main (b1284f2)

Summary

✅ 2 untouched benchmarks

Base automatically changed from patch-schedules to main February 7, 2025 17:34
@desertaxle desertaxle force-pushed the deployment-schedule-sdk-updates branch from 6467278 to ea20178 Compare February 7, 2025 17:35
@desertaxle desertaxle marked this pull request as ready for review February 7, 2025 17:49
@@ -49,6 +50,7 @@ class Schedule:
day_or: bool = False
active: bool = True
parameters: dict[str, Any] = dataclasses.field(default_factory=dict)
slug: str | None = None
Copy link
Member

Choose a reason for hiding this comment

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

this will prob fail 3.9 checks

Copy link
Member

Choose a reason for hiding this comment

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

errr or maybe not?

Copy link
Member Author

Choose a reason for hiding this comment

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

The from __future__ import annotations at the top does some black magic that makes this work in 3.9.

Copy link
Member

@cicdw cicdw left a comment

Choose a reason for hiding this comment

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

straightforward, LGTM

@desertaxle desertaxle merged commit 2bc2cf6 into main Feb 7, 2025
50 checks passed
@desertaxle desertaxle deleted the deployment-schedule-sdk-updates branch February 7, 2025 17:54
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.

2 participants