|
77 | 77 | TypeDefResponse, |
78 | 78 | ) |
79 | 79 | from pyatlan.utils import HTTPStatus, get_logger |
80 | | -from pyatlan.cache import CustomMetadataCache, ClassificationCache |
81 | 80 |
|
82 | 81 | LOGGER = get_logger() |
83 | 82 | T = TypeVar("T", bound=Referenceable) |
@@ -484,15 +483,19 @@ def create_typedef(self, typedef: TypeDef) -> TypeDefResponse: |
484 | 483 | CREATE_TYPE_DEFS, request_obj=payload, exclude_unset=False |
485 | 484 | ) |
486 | 485 | if isinstance(typedef, ClassificationDef): |
| 486 | + from pyatlan.cache.classification_cache import ClassificationCache |
487 | 487 | ClassificationCache.refresh_cache() |
488 | 488 | if isinstance(typedef, CustomMetadataDef): |
| 489 | + from pyatlan.cache.custom_metadata_cache import CustomMetadataCache |
489 | 490 | CustomMetadataCache.refresh_cache() |
490 | 491 | return TypeDefResponse(**raw_json) |
491 | 492 |
|
492 | 493 | def purge_typedef(self, internal_name: str) -> None: |
493 | 494 | self._call_api(DELETE_TYPE_DEF_BY_NAME.format_path_with_params(internal_name)) |
494 | 495 | # TODO: if we know which kind of typedef is being purged, we only need |
495 | 496 | # to refresh that particular cache |
| 497 | + from pyatlan.cache.classification_cache import ClassificationCache |
| 498 | + from pyatlan.cache.custom_metadata_cache import CustomMetadataCache |
496 | 499 | ClassificationCache.refresh_cache() |
497 | 500 | CustomMetadataCache.refresh_cache() |
498 | 501 |
|
|
0 commit comments