File tree Expand file tree Collapse file tree
packages/bigframes/bigframes/_tools Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,14 +31,23 @@ def decorator(target_class):
3131 if hasattr (source_item , "__doc__" ) and source_item .__doc__ :
3232 try :
3333 target_item .__doc__ = source_item .__doc__
34- if isinstance (target_item , property ) and target_item .fget :
35- try :
36- target_item .fget .__doc__ = source_item .__doc__
37- except AttributeError :
38- pass
3934 except AttributeError :
4035 pass
4136
37+ underlying = None
38+ if isinstance (target_item , property ):
39+ underlying = target_item .fget
40+ elif hasattr (target_item , "__func__" ):
41+ underlying = target_item .__func__
42+ elif hasattr (target_item , "func" ):
43+ underlying = getattr (target_item , "func" , None )
44+
45+ if underlying is not None :
46+ try :
47+ underlying .__doc__ = source_item .__doc__
48+ except AttributeError :
49+ pass
50+
4251 return target_class
4352
4453 return decorator
You can’t perform that action at this time.
0 commit comments