Skip to content

Commit 436d416

Browse files
committed
fix ruff error
1 parent c812b60 commit 436d416

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

traincheck/instrumentor/source_file.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -618,8 +618,8 @@ def at_attr(name: str) -> bool:
618618
new_src = "".join(new_lines)
619619

620620
def _find_annotate_import_idx(lines):
621-
for idx, l in enumerate(lines):
622-
if re.match(r"^\s*from\s+traincheck\s+import\s+annotate_stage\s*$", l):
621+
for idx, line in enumerate(lines):
622+
if re.match(r"^\s*from\s+traincheck\s+import\s+annotate_stage\s*$", line):
623623
return idx
624624
return -1
625625

traincheck/trace/trace_pandas.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,11 @@ def _rm_incomplete_trailing_func_calls(self):
183183
self.events.groupby("func_call_id").size().reset_index(name="count")
184184
)
185185

186+
multiple_func_call_ids = func_call_groups[func_call_groups["count"] >2][
187+
"func_call_id"
188+
]
189+
assert len(multiple_func_call_ids)==0, "more than 2 events for one func call id"
190+
186191
incomplete_func_call_ids = func_call_groups[func_call_groups["count"] == 1][
187192
"func_call_id"
188193
]

0 commit comments

Comments
 (0)