Skip to content

Commit 20648ec

Browse files
fix(model): add mode_report relationship to ModeChart
ModeChart was missing the mode_report relationship field that maps a chart to its parent report. The Atlas typedef supports this attribute (the legacy Jinja2 transformer writes it), and ModeQuery already has the equivalent field. This was an oversight in model generation. Adds: RelationField, property, setter, and Attributes field following the same pattern as ModeQuery.mode_report.
1 parent 4cdcf91 commit 20648ec

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

pyatlan/model/assets/mode_chart.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,15 @@ def __setattr__(self, name, value):
4141
TBC
4242
"""
4343

44+
MODE_REPORT: ClassVar[RelationField] = RelationField("modeReport")
45+
"""
46+
Report to which this chart belongs.
47+
"""
48+
4449
_convenience_properties: ClassVar[List[str]] = [
4550
"mode_chart_type",
4651
"mode_query",
52+
"mode_report",
4753
]
4854

4955
@property
@@ -66,11 +72,24 @@ def mode_query(self, mode_query: Optional[ModeQuery]):
6672
self.attributes = self.Attributes()
6773
self.attributes.mode_query = mode_query
6874

75+
@property
76+
def mode_report(self) -> Optional[ModeReport]:
77+
return None if self.attributes is None else self.attributes.mode_report
78+
79+
@mode_report.setter
80+
def mode_report(self, mode_report: Optional[ModeReport]):
81+
if self.attributes is None:
82+
self.attributes = self.Attributes()
83+
self.attributes.mode_report = mode_report
84+
6985
class Attributes(Mode.Attributes):
7086
mode_chart_type: Optional[str] = Field(default=None, description="")
7187
mode_query: Optional[ModeQuery] = Field(
7288
default=None, description=""
7389
) # relationship
90+
mode_report: Optional[ModeReport] = Field(
91+
default=None, description=""
92+
) # relationship
7493

7594
attributes: ModeChart.Attributes = Field(
7695
default_factory=lambda: ModeChart.Attributes(),
@@ -83,5 +102,6 @@ class Attributes(Mode.Attributes):
83102

84103

85104
from .mode_query import ModeQuery # noqa: E402, F401
105+
from .mode_report import ModeReport # noqa: E402, F401
86106

87107
ModeChart.Attributes.update_forward_refs()

0 commit comments

Comments
 (0)