File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -2910,7 +2910,7 @@ def run(
2910
2910
)
2911
2911
2912
2912
@staticmethod
2913
- def _get_computation_code (stacklevel = None ) -> str :
2913
+ def _get_computation_code (stacklevel : int | None = None ) -> str :
2914
2914
"""Walk up the stack to the user code and extract the code surrounding
2915
2915
the compute/submit/persist call. All modules encountered which are
2916
2916
ignored through the option
@@ -2921,7 +2921,6 @@ def _get_computation_code(stacklevel=None) -> str:
2921
2921
``stacklevel`` may be used to explicitly indicate from which frame on
2922
2922
the stack to get the source code.
2923
2923
"""
2924
-
2925
2924
ignore_modules = dask .config .get (
2926
2925
"distributed.diagnostics.computations.ignore-modules"
2927
2926
)
@@ -2939,7 +2938,8 @@ def _get_computation_code(stacklevel=None) -> str:
2939
2938
else :
2940
2939
# stacklevel 0 or less - shows dask internals which likely isn't helpful
2941
2940
stacklevel = stacklevel if stacklevel > 0 else 1
2942
- for i , (fr , _ ) in enumerate (traceback .walk_stack (None ), 1 ):
2941
+
2942
+ for i , (fr , _ ) in enumerate (traceback .walk_stack (sys ._getframe ().f_back ), 1 ):
2943
2943
if stacklevel is not None :
2944
2944
if i != stacklevel :
2945
2945
continue
You can’t perform that action at this time.
0 commit comments