@@ -381,13 +381,15 @@ def __init__(
381381 _page_size : Optional [int ] = None ,
382382 _includes_on_results : Optional [List [str ]] = None ,
383383 _includes_on_relations : Optional [List [str ]] = None ,
384+ _include_relationship_attributes : Optional [bool ] = False ,
384385 ):
385386 super ().__init__ (wheres , where_nots , where_somes , _min_somes )
386387 self .sorts = sorts
387388 self .aggregations = aggregations
388389 self ._page_size = _page_size
389390 self ._includes_on_results = _includes_on_results
390391 self ._includes_on_relations = _includes_on_relations
392+ self ._include_relationship_attributes = _include_relationship_attributes
391393
392394 def _clone (self ) -> "FluentSearch" :
393395 """
@@ -468,6 +470,22 @@ def include_on_relations(self, field: Union[str, AtlanField]) -> "FluentSearch":
468470 clone ._includes_on_relations .append (field )
469471 return clone
470472
473+ def include_relationship_attributes (self , include : bool ) -> "FluentSearch" :
474+ """
475+ Add an attribute to include relationship attributes on each relationship in the results.
476+
477+ :param include: include relationship attributes on each relationship in the results
478+ :returns: the fluent search with this parameter added
479+ """
480+ clone = self ._clone ()
481+ # When enabling `include_relationship_attributes`
482+ # it's mandatory to include the "name" field
483+ # to ensure relationship names are included in the response.
484+ # Omitting "name" will result in a 500 error from the metastore.
485+ clone = self .include_on_relations ("name" )
486+ clone ._include_relationship_attributes = include
487+ return clone
488+
471489 def _dsl (self ) -> DSL :
472490 """
473491 Translate the Atlan fluent search into an Atlan search DSL.
@@ -495,6 +513,10 @@ def to_request(self) -> IndexSearchRequest:
495513 request .attributes = self ._includes_on_results
496514 if self ._includes_on_relations :
497515 request .relation_attributes = self ._includes_on_relations
516+ if self ._include_relationship_attributes :
517+ request .include_relationship_attributes = (
518+ self ._include_relationship_attributes
519+ )
498520 return request
499521
500522 def count (self , client : AtlanClient ) -> int :
0 commit comments