Skip to content

Can't pass parameters to a Clock unless they have default values #2296

Closed
@limx0

Description

Description

A clear description of the bug
I would like to create a flow on a schedule, passing in default parameters. Currently this fails unless all parameters have default values.

Expected Behavior

What did you expect to happen instead?
Passing parameters should be allowed even if they do not have defaults - we should be able to resolve the following example

Reproduction

A minimal example that exhibits the behavior.


from prefect.schedules import Schedule
from prefect.schedules.clocks import CronClock


@task
def add(a, b):
    return a + b


schedule = Schedule(clocks=[
    CronClock(
        cron=f"* * * * *",
        parameter_defaults={
            'a': 1,
        }
    )
])

with Flow('flow', schedule=schedule) as flow:
    a = Parameter('a')
    b = Parameter('b', default=1)
    result = add(a, b)

flow.register()

Environment

Any additional information about your environment

Optionally run prefect diagnostics from the command line and paste the information here

Activity

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions