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

Allow definition of per-schedule parameters via .serve and .deploy #16965

Merged

Conversation

desertaxle
Copy link
Member

@desertaxle desertaxle commented Feb 4, 2025

Example:

import datetime

from prefect import flow
from prefect.schedules import Interval

@flow
def add_two(number: int):
    return number + 2

if __name__ == "__main__":
    add_two.serve(
       "test",
        schedule=Interval(3600, parameters={"number": 42})
)

Closes #14972

@github-actions github-actions bot added the ui-replatform Related to the React UI rewrite label Feb 4, 2025
Base automatically changed from add-params-to-scheduler to main February 4, 2025 23:40
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.

a few small notes - also the other PR was merged so you can rebase

@desertaxle desertaxle force-pushed the overide-parameters-per-schedule-python-sdk-oss-6190 branch from 6859d56 to 2d44b3a Compare February 5, 2025 01:30
Copy link

codspeed-hq bot commented Feb 5, 2025

CodSpeed Performance Report

Merging #16965 will not alter performance

Comparing overide-parameters-per-schedule-python-sdk-oss-6190 (328e909) with main (200ac99)

Summary

✅ 2 untouched benchmarks

@desertaxle desertaxle force-pushed the overide-parameters-per-schedule-python-sdk-oss-6190 branch from 6902b7e to fa51087 Compare February 5, 2025 03:08
@desertaxle desertaxle added enhancement An improvement of an existing feature and removed ui-replatform Related to the React UI rewrite labels Feb 5, 2025
@desertaxle desertaxle force-pushed the overide-parameters-per-schedule-python-sdk-oss-6190 branch from 3e145e3 to 328e909 Compare February 5, 2025 15:01
@desertaxle desertaxle marked this pull request as ready for review February 5, 2025 15:26
@desertaxle desertaxle requested a review from zzstoatzz as a code owner February 5, 2025 15:26
@desertaxle desertaxle requested a review from cicdw February 5, 2025 15:26
Copy link
Collaborator

@zzstoatzz zzstoatzz left a comment

Choose a reason for hiding this comment

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

lgtm, only question is whether we should complain if you pass both schedule and schedules

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.

Wow, nice! This LGTM - note that it also closes #14972

@desertaxle
Copy link
Member Author

lgtm, only question is whether we should complain if you pass both schedule and schedules

@zzstoatzz, the changes in this PR should raise if both schedule and schedules are provided, but let me double-check that we have test coverage for the various entry points.

@zzstoatzz
Copy link
Collaborator

zzstoatzz commented Feb 5, 2025

lgtm, only question is whether we should complain if you pass both schedule and schedules

@zzstoatzz, the changes in this PR should raise if both schedule and schedules are provided, but let me double-check that we have test coverage for the various entry points.

aha i must have missed an update - just tested and it LGTM now on that point @desertaxle

@desertaxle desertaxle merged commit fee2870 into main Feb 5, 2025
50 checks passed
@desertaxle desertaxle deleted the overide-parameters-per-schedule-python-sdk-oss-6190 branch February 5, 2025 17:00
kevingrismore pushed a commit that referenced this pull request Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement of an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make schedules interface more expressive
3 participants