diff --git a/dsp_permissions_scripts/oap/oap_serialize.py b/dsp_permissions_scripts/oap/oap_serialize.py index 8a7e9c4c..d919e688 100644 --- a/dsp_permissions_scripts/oap/oap_serialize.py +++ b/dsp_permissions_scripts/oap/oap_serialize.py @@ -79,10 +79,10 @@ def _iri_filter(res_oap: ResourceOap, iri: str) -> bool: oaps: list[Oap] = [] deserialized_resource_iris = [] - for res_iri, val_oaps in itertools.groupby(val_oaps, key=lambda x: x.resource_iri): + for res_iri, _val_oaps in itertools.groupby(val_oaps, key=lambda x: x.resource_iri): filtered = list(filter(_iri_filter, res_oaps)) res_oap = filtered[0] if filtered else None - oaps.append(Oap(resource_oap=res_oap, value_oaps=val_oaps)) + oaps.append(Oap(resource_oap=res_oap, value_oaps=_val_oaps)) deserialized_resource_iris.append(res_iri) remaining_res_oaps = [oap for oap in res_oaps if oap.resource_iri not in deserialized_resource_iris]