From 5d7b4fbbccb8456da27d4b181969c60fd0c053cf Mon Sep 17 00:00:00 2001 From: Masterchen09 <13187726+Masterchen09@users.noreply.github.com> Date: Tue, 13 Aug 2024 18:43:19 +0200 Subject: [PATCH] fix hashability of frozen Resource dataclass (use FrozenSet instead of Set) --- metadata-ingestion/src/datahub/ingestion/source/sac/sac.py | 2 +- .../src/datahub/ingestion/source/sac/sac_common.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/metadata-ingestion/src/datahub/ingestion/source/sac/sac.py b/metadata-ingestion/src/datahub/ingestion/source/sac/sac.py index ad93aee96bd18..88cb1f821ff0d 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/sac/sac.py +++ b/metadata-ingestion/src/datahub/ingestion/source/sac/sac.py @@ -682,7 +682,7 @@ def get_resources(self) -> Iterable[Resource]: open_url=entity.openURL, ancestor_path=ancestor_path, is_mobile=entity.isMobile, - resource_models=resource_models, + resource_models=frozenset(resource_models), ) def get_import_data_model_ids(self) -> Set[str]: diff --git a/metadata-ingestion/src/datahub/ingestion/source/sac/sac_common.py b/metadata-ingestion/src/datahub/ingestion/source/sac/sac_common.py index fa284a9b06715..457fda1e06181 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/sac/sac_common.py +++ b/metadata-ingestion/src/datahub/ingestion/source/sac/sac_common.py @@ -1,6 +1,6 @@ from dataclasses import dataclass from datetime import datetime -from typing import Optional, Set +from typing import FrozenSet, Optional @dataclass(frozen=True) @@ -30,7 +30,7 @@ class Resource: open_url: str ancestor_path: Optional[str] is_mobile: bool - resource_models: Set[ResourceModel] + resource_models: FrozenSet[ResourceModel] @dataclass(frozen=True)