@@ -1406,15 +1406,26 @@ def _get_ttree_form(
14061406 contents = []
14071407 for key in common_keys :
14081408 branch = ttree [key ]
1409- content_form = branch .interpretation .awkward_form (ttree .file )
1409+ if isinstance (branch , HasFields ):
1410+ content_form = branch .to_akform ()[0 ].content (0 )
1411+ else :
1412+ content_form = branch .interpretation .awkward_form (ttree .file )
14101413 content_parameters = {}
14111414 if isinstance (ak_add_doc , bool ):
14121415 if ak_add_doc :
1413- content_parameters ["__doc__" ] = branch .title
1416+ content_parameters ["__doc__" ] = (
1417+ branch .description
1418+ if isinstance (branch , HasFields )
1419+ else branch .title
1420+ )
14141421 elif isinstance (ak_add_doc , dict ):
14151422 content_parameters .update (
14161423 {
1417- key : branch .__getattribute__ (value )
1424+ key : branch .__getattribute__ (
1425+ "description"
1426+ if isinstance (branch , HasFields ) and value == "title"
1427+ else value
1428+ )
14181429 for key , value in ak_add_doc .items ()
14191430 }
14201431 )
@@ -1423,10 +1434,24 @@ def _get_ttree_form(
14231434 contents .append (content_form )
14241435
14251436 if isinstance (ak_add_doc , bool ):
1426- parameters = {"__doc__" : ttree .title } if ak_add_doc else None
1437+ parameters = (
1438+ {
1439+ "__doc__" : (
1440+ ttree .description if isinstance (ttree , HasFields ) else ttree .title
1441+ )
1442+ }
1443+ if ak_add_doc
1444+ else None
1445+ )
14271446 elif isinstance (ak_add_doc , dict ):
14281447 parameters = (
1429- {"__doc__" : ttree .title } if "__doc__" in ak_add_doc .keys () else None
1448+ {
1449+ "__doc__" : (
1450+ ttree .description if isinstance (ttree , HasFields ) else ttree .title
1451+ )
1452+ }
1453+ if "__doc__" in ak_add_doc .keys ()
1454+ else None
14301455 )
14311456 else :
14321457 parameters = None
0 commit comments