Skip to content

Refactor trigger decorator and deploy time evaluation logic #2290

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

talsperre
Copy link
Collaborator

@talsperre talsperre commented Feb 22, 2025

Refactored @trigger logic and simplified the deploy time evaluation logic of @trigger decorator. The current implementation is buggy and fails when running trigger4.py in this gist here.

For testing, refer to all the flows in this gist here. We can add few more tests as well if needed.

Change in contract:

Previously, we allowed deploy time functions (not documented anywhere) at various levels in the @trigger decorator. So something like this was possible:

@trigger(
    events=[
        {
            "name": myfunc1,
            "parameters": [myfunc2, myfunc3]
        },
)
class MyFlow(FlowSpec):

Now, we only allow specifying all of parameters as a deploy time function:

@trigger(
    events=[
        {
            "name": myfunc1,
            "parameters": myfunc2
        },
)
class MyFlow(FlowSpec):

These are also still allowed:

@trigger(events=myfunc)
class MyFlow(FlowSpec):
@trigger(events=[myfunc1, myfunc2])
class MyFlow(FlowSpec):

@nflx-mf-bot
Copy link
Collaborator

Netflix internal testing[4457218] @ 3b7ef8e

@nflx-mf-bot
Copy link
Collaborator

Testing for OSS PR [1052] @ commit 3b7ef8e had 11 FAILUREs.

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

Successfully merging this pull request may close these issues.

3 participants