Skip to content

Commit b4f44ad

Browse files
authored
Merge pull request #7515 from opsmill/pog-fix-python-query-automation-setup
Fix an error in the setup of python query automations in Prefect
2 parents 364e690 + 49d6245 commit b4f44ad

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

backend/infrahub/trigger/setup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ async def setup_triggers_specific(
5252
) # type: ignore[misc]
5353

5454

55-
@task(name="trigger-setup", task_run_name="Setup triggers", cache_policy=NONE) # type: ignore[arg-type]
55+
@task(name="trigger-setup", task_run_name="Setup triggers", cache_policy=NONE)
5656
async def setup_triggers(
5757
client: PrefectClient,
5858
triggers: list[TriggerDefinition],
@@ -84,7 +84,9 @@ async def setup_triggers(
8484
existing_automations: dict[str, Automation] = {}
8585
if trigger_type:
8686
existing_automations = {
87-
item.name: item for item in await client.read_automations() if item.name.startswith(trigger_type.value)
87+
item.name: item
88+
for item in await client.read_automations()
89+
if item.name.startswith(f"{trigger_type.value}::")
8890
}
8991
else:
9092
existing_automations = {item.name: item for item in await client.read_automations()}

0 commit comments

Comments
 (0)