@@ -9,7 +9,7 @@ from typing import Any, ClassVar, Dict, List, Optional, TypeVar
99
1010from pydantic import Field, StrictStr, root_validator, validator
1111
12- from pyatlan.model.core import Announcement, AtlanObject, BusinessAttributes , Classification, Meaning
12+ from pyatlan.model.core import Announcement, AtlanObject, CustomMetadata , Classification, Meaning
1313from pyatlan.model.enums import (
1414 ADLSAccessTier,
1515 ADLSAccountStatus,
@@ -226,7 +226,7 @@ class {{ entity_def.name }}({{super_classes[0]}} {%- if "Asset" in super_classes
226226 if not self.create_time or self.created_by:
227227 self.attributes.validate_required()
228228
229- def get_business_attributes (self, name: str) -> BusinessAttributes :
229+ def get_custom_metadata (self, name: str) -> CustomMetadata :
230230 from pyatlan.cache.custom_metadata_cache import CustomMetadataCache
231231
232232 ba_id = CustomMetadataCache.get_id_for_name(name)
@@ -240,7 +240,7 @@ class {{ entity_def.name }}({{super_classes[0]}} {%- if "Asset" in super_classes
240240 break
241241 else:
242242 raise ValueError(
243- f"Business attributes {name} are not applicable to {self.type_name}"
243+ f"Custom metadata attributes {name} are not applicable to {self.type_name}"
244244 )
245245 if ba_type := CustomMetadataCache.get_type_for_id(ba_id):
246246 return (
@@ -250,27 +250,27 @@ class {{ entity_def.name }}({{super_classes[0]}} {%- if "Asset" in super_classes
250250 )
251251 else:
252252 raise ValueError(
253- f"Business attributes {name} are not applicable to {self.type_name}"
253+ f"Custom metadata attributes {name} are not applicable to {self.type_name}"
254254 )
255255
256- def set_business_attribute (self, business_attributes: BusinessAttributes ) -> None:
256+ def set_custom_metadata (self, custom_metadata: CustomMetadata ) -> None:
257257 from pyatlan.cache.custom_metadata_cache import CustomMetadataCache
258258
259- if not isinstance(business_attributes, BusinessAttributes ):
259+ if not isinstance(custom_metadata, CustomMetadata ):
260260 raise ValueError(
261- "business_attributes must be an instance of BusinessAttributes "
261+ "business_attributes must be an instance of CustomMetadata "
262262 )
263263 if (
264- type(business_attributes )
264+ type(custom_metadata )
265265 not in CustomMetadataCache.types_by_asset[self.type_name]
266266 ):
267267 raise ValueError(
268- f"Business attributes {business_attributes ._meta_data_type_name} are not applicable to {self.type_name}"
268+ f"Business attributes {custom_metadata ._meta_data_type_name} are not applicable to {self.type_name}"
269269 )
270- ba_dict = dict(business_attributes )
270+ ba_dict = dict(custom_metadata )
271271 if not self.business_attributes:
272272 self.business_attributes = {}
273- self.business_attributes[business_attributes ._meta_data_type_id] = ba_dict
273+ self.business_attributes[custom_metadata ._meta_data_type_id] = ba_dict
274274
275275{% - else %}
276276 {% - if entity_def .name == "Asset" %}
@@ -536,7 +536,7 @@ class {{ entity_def.name }}({{super_classes[0]}} {%- if "Asset" in super_classes
536536 )
537537 else:
538538 raise ValueError(
539- f "parent_type must be either Table, View or MaterializeView"
539+ "parent_type must be either Table, View or MaterializeView"
540540 )
541541 return ret_value
542542
0 commit comments