(step_id: Union[int, str])
| 84 | |
| 85 | |
| 86 | def get_step_depth(step_id: Union[int, str]) -> int: |
| 87 | if not step_id: |
| 88 | return 0 |
| 89 | |
| 90 | parts = str(step_id).split(".") |
| 91 | depth = 0 |
| 92 | skip_next = False |
| 93 | |
| 94 | for part in parts: |
| 95 | if skip_next: |
| 96 | skip_next = False |
| 97 | continue |
| 98 | |
| 99 | if part == "tool": |
| 100 | skip_next = True |
| 101 | |
| 102 | depth += 1 |
| 103 | |
| 104 | return max(0, depth - 1) |
no outgoing calls
no test coverage detected