diff --git a/CHANGELOG.md b/CHANGELOG.md index ba870fd6cb..0378b2bca1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ The types of changes are: ### Fixed * Fix error in parent user creation seeding. [#1832](https://github.com/ethyca/fides/issues/1832) +* Fix DSR error due to unfiltered empty identities [#1901](https://github.com/ethyca/fides/pull/1907) ### Docs diff --git a/src/fides/api/ops/models/privacy_request.py b/src/fides/api/ops/models/privacy_request.py index c4f2221acd..906d18ff7a 100644 --- a/src/fides/api/ops/models/privacy_request.py +++ b/src/fides/api/ops/models/privacy_request.py @@ -281,7 +281,7 @@ def persist_identity(self, db: Session, identity: Identity) -> None: """ identity_dict: Dict[str, Any] = dict(identity) for key, value in identity_dict.items(): - if value is not None: + if value: hashed_value = ProvidedIdentity.hash_value(value) ProvidedIdentity.create( db=db, diff --git a/src/fides/api/ops/service/connectors/saas_query_config.py b/src/fides/api/ops/service/connectors/saas_query_config.py index 938ae0b138..db0646ad0a 100644 --- a/src/fides/api/ops/service/connectors/saas_query_config.py +++ b/src/fides/api/ops/service/connectors/saas_query_config.py @@ -203,7 +203,11 @@ def _get_identity(self) -> Optional[str]: identities: List[str] = [] if self.privacy_request: - identities = list(self.privacy_request.get_cached_identity_data().keys()) + identity_data: Dict[ + str, Any + ] = self.privacy_request.get_cached_identity_data() + # filters out keys where associated value is None or empty str + identities = list({k for k, v in identity_data.items() if v}) if len(identities) > 1: raise FidesopsException( "Only one identity can be specified for SaaS connector traversal"