Skip to content

Commit da980d8

Browse files
committed
[gen/fix] Fixed pyatlan 6 changes in the templates
1 parent 162a403 commit da980d8

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

pyatlan/generator/templates/methods/attribute/badge.jinja2

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@
1313
["name", "cm_name", "cm_attribute", "badge_conditions"],
1414
[name, cm_name, cm_attribute, badge_conditions],
1515
)
16-
from pyatlan.cache.custom_metadata_cache import CustomMetadataCache
16+
from pyatlan.client.atlan import AtlanClient
1717

18-
cm_id = CustomMetadataCache.get_id_for_name(cm_name)
19-
cm_attr_id = CustomMetadataCache.get_attr_id_for_name(
18+
client = AtlanClient.get_current_client()
19+
cm_id = client.custom_metadata_cache.get_id_for_name(cm_name)
20+
cm_attr_id = client.custom_metadata_cache.get_attr_id_for_name(
2021
set_name=cm_name, attr_name=cm_attribute
2122
)
2223
return Badge.Attributes(

pyatlan/generator/templates/referenceable_methods.jinja2

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,13 @@
5959

6060
@property
6161
def atlan_tag_names(self) -> List[str]:
62-
from pyatlan.cache.atlan_tag_cache import AtlanTagCache
62+
from pyatlan.client.atlan import AtlanClient
6363
from pyatlan.model.constants import DELETED_
6464

6565
if self.classification_names:
6666
return [
67-
AtlanTagCache.get_name_for_id(tag_id) or DELETED_
67+
AtlanClient.get_current_client().atlan_tag_cache.get_name_for_id(tag_id)
68+
or DELETED_
6869
for tag_id in self.classification_names
6970
]
7071
return []

0 commit comments

Comments
 (0)