@@ -30,12 +30,19 @@ def __call__(self, *args, **kwargs):
30
30
#ipdb.set_trace()
31
31
32
32
method_call_obj = None
33
- if sc .scf .level == 1 :
34
- global start_method_call
33
+ global start_method_call
34
+ stack_depth = sc .scf .level
35
+ if stack_depth == 1 :
35
36
if start_method_call :
36
- method_call_obj = start_method_call (self ._obj , method .__name__ , args , kwargs )
37
-
38
- ret = method (self ._obj , * args , ** kwargs )
37
+ method_call_obj = start_method_call (self ._obj , method .__name__ , args , kwargs , stack_depth )
38
+ ret = method (self ._obj , * args , ** kwargs )
39
+ elif stack_depth == 2 and method .__name__ == 'copy' :
40
+ #ipdb.set_trace()
41
+ if start_method_call :
42
+ method_call_obj = start_method_call (self ._obj , method .__name__ , args , kwargs , stack_depth )
43
+ ret = method (self ._obj , * args , ** kwargs )
44
+ else :
45
+ ret = method (self ._obj , * args , ** kwargs )
39
46
40
47
if method_call_obj :
41
48
method_call_obj .handle_end_method_call (ret )
@@ -63,10 +70,11 @@ def __init__(self, pandas_obj):
63
70
def __call__ (self , * args , ** kwargs ):
64
71
with stack_counter .global_scf .get_sc () as sc :
65
72
method_call_obj = None
66
- if sc .scf .level <= 2 :
73
+ stack_depth = sc .scf .level
74
+ if stack_depth <= 2 :
67
75
global start_method_call
68
76
if start_method_call :
69
- method_call_obj = start_method_call (self ._obj , method .__name__ , args , kwargs )
77
+ method_call_obj = start_method_call (self ._obj , method .__name__ , args , kwargs , stack_depth )
70
78
71
79
ret = method (self ._obj , * args , ** kwargs )
72
80
0 commit comments