Skip to content

Commit cacf060

Browse files
committed
fix: correct placement of CRON type in StateManager triggers
- Moved the "type": "CRON" field to the correct location within the triggers body in the StateManager class. - Ensured proper structure for trigger configuration, enhancing clarity and functionality.
1 parent 2437624 commit cacf060

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

python-sdk/exospherehost/statemanager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ async def upsert_graph(self, graph_name: str, graph_nodes: list[GraphNodeModel],
171171
if triggers is not None:
172172
body["triggers"] = [
173173
{
174-
"type": "CRON",
175174
"value": {
175+
"type": "CRON",
176176
"expression": trigger.expression,
177177
"timezone": trigger.timezone
178178
}

state-manager/app/models/trigger_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def validate_timezone(cls, v: str) -> str:
3737
return v
3838

3939
# Union type for all trigger types - add new trigger types here
40-
TriggerValue = Annotated[Union[CronTrigger], Field(discriminator="type")]
40+
TriggerValue = Annotated[Union[CronTrigger], Field(discriminator="type")] # type: ignore
4141

4242
class Trigger(BaseModel):
4343
"""

0 commit comments

Comments
 (0)