Skip to content

Commit cb6fcc2

Browse files
committed
Added a new logic to handle this
1 parent 4e9e898 commit cb6fcc2

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

pyatlan/model/typedef.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

33
import json
4+
import sys
45
import time
56
from typing import Any, Callable, ClassVar, Dict, List, Optional, Set, cast
67

@@ -662,17 +663,25 @@ def applicable_asset_types(self) -> AssetTypes:
662663
return set()
663664

664665
@applicable_asset_types.setter
665-
def applicable_asset_types(self, asset_types: AssetTypes):
666+
def applicable_asset_types(self, asset_types):
666667
if self.options is None:
667668
raise ErrorCode.MISSING_OPTIONS.exception_with_parameters()
668669
if not isinstance(asset_types, set):
669670
raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters(
670671
"applicable_asset_types", AssetTypes
671672
)
672-
if not asset_types.issubset(_complete_type_list):
673+
invalid_types = set()
674+
for asset_type in asset_types:
675+
if not getattr(
676+
sys.modules.get("pyatlan.model.assets", {}), asset_type, None
677+
):
678+
invalid_types.add(asset_type)
679+
680+
if invalid_types:
673681
raise ErrorCode.INVALID_PARAMETER_VALUE.exception_with_parameters(
674-
asset_types, "applicable_asset_types", _complete_type_list
682+
asset_types, "applicable_asset_types", "SDK asset types"
675683
)
684+
676685
self.options.applicable_asset_types = json.dumps(list(asset_types))
677686

678687
@property

0 commit comments

Comments
 (0)