Skip to content

Commit

Permalink
Auto follow-up: add missing filter templating step (#276)
Browse files Browse the repository at this point in the history
* add templating on fp_hists in auto_followup pipeline to avoid error when running the filters
  • Loading branch information
Theodlz authored Feb 14, 2024
1 parent 4354f29 commit bf628f7
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions kowalski/alert_brokers/alert_broker_ztf.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,15 @@ def make_filter_templates(self, active_filters: Sequence):
]["$filter"]["cond"]["$and"][0]["$in"][1] = active_filter[
"permissions"
]
if (
"fp_hists"
in active_filter["autosave"]["pipeline"][3]["$project"]
):
active_filter["autosave"]["pipeline"][3]["$project"][
"fp_hists"
]["$filter"]["cond"]["$and"][0]["$in"][1] = active_filter[
"permissions"
]
# same for the auto_followup pipeline:
if (
isinstance(active_filter.get("auto_followup", None), dict)
Expand All @@ -396,6 +405,15 @@ def make_filter_templates(self, active_filters: Sequence):
]["$filter"]["cond"]["$and"][0]["$in"][1] = active_filter[
"permissions"
]
if (
"fp_hists"
in active_filter["auto_followup"]["pipeline"][3]["$project"]
):
active_filter["auto_followup"]["pipeline"][3]["$project"][
"fp_hists"
]["$filter"]["cond"]["$and"][0]["$in"][1] = active_filter[
"permissions"
]

filter_template = {
"group_id": active_filter["group_id"],
Expand Down

0 comments on commit bf628f7

Please sign in to comment.