@@ -5,6 +5,7 @@ from datetime import datetime
5
5
from pyatlan.model.core import AtlanObject, Classification, Announcement
6
6
from pyatlan.model.enums import CertificateStatus, EntityStatus, google_datastudio_asset_type, powerbi_endorsement, \
7
7
IconType, AnnouncementType, SourceCostUnitType
8
+ from pyatlan.utils import next_id
8
9
9
10
class Internal(AtlanObject):
10
11
"""For internal usage"""
@@ -29,7 +30,8 @@ class {{ entity_def.name }}({{super_classes[0]}}):
29
30
class Attributes(AtlanObject):
30
31
{% - for attribute_def in entity_def .attribute_defs %}
31
32
{% - set type = attribute_def .typeName | get_type %}
32
- {{attribute_def.name | to_snake_case }}: {% if attribute_def .isOptional %} Optional[{% endif %} {{type}}{% if attribute_def .isOptional %} ]{% endif %} = Field(None, description='' , alias='{{attribute_def.name}}')
33
+ {% - set default_value = "''" if attribute_def .name == "qualifiedName" else "None" %}
34
+ {{attribute_def.name | to_snake_case }}: {% if attribute_def .isOptional %} Optional[{% endif %} {{type}}{% if attribute_def .isOptional %} ]{% endif %} = Field({{ default_value }}, description='' , alias='{{attribute_def.name}}')
33
35
{% - endfor %}
34
36
{% - for attribute_def in entity_def .relationship_attribute_defs %}
35
37
{% - set type = attribute_def .typeName | get_type %}
@@ -56,9 +58,9 @@ class {{ entity_def.name }}({{super_classes[0]}}):
56
58
example=1648852296555,
57
59
)
58
60
guid: Optional[str] = Field(
59
- None,
60
61
description='Unique identifier of the entity instance.\n',
61
62
example='917ffec9-fa84-4c59-8e6c-c7b114d04be3',
63
+ default_factory=next_id,
62
64
)
63
65
is_incomplete: Optional[bool] = Field(False, description='', example=False)
64
66
labels: Optional[List[str]] = Field(None, description='Internal use only.')
@@ -124,7 +126,7 @@ class {{ entity_def.name }}({{super_classes[0]}}):
124
126
{% - if entity_def .attribute_defs %}
125
127
{% - if not entity_def .sub_types %}
126
128
127
- type_name: Literal['{{ entity_def.name }}']
129
+ type_name: Literal['{{ entity_def.name }}'] = Field("{{ entity_def.name }}")
128
130
129
131
{% - endif %}
130
132
class Attributes({{super_classes[0] }}.Attributes):
0 commit comments