Skip to content

Commit 6a19b9d

Browse files
fix: add type assertions for mypy narrowing in worktree path remapping
1 parent d43d9ae commit 6a19b9d

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

codeflash/optimization/optimizer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ def get_optimizable_functions(self) -> tuple[dict[Path, list[FunctionToOptimize]
193193
self.current_worktree and self.original_args_and_test_cfg and not self.args.all and not self.args.file
194194
)
195195
if use_original_roots:
196+
assert self.original_args_and_test_cfg is not None
196197
original_args, _ = self.original_args_and_test_cfg
197198
project_root = original_args.project_root
198199
module_root = original_args.module_root
@@ -214,6 +215,7 @@ def get_optimizable_functions(self) -> tuple[dict[Path, list[FunctionToOptimize]
214215
if use_original_roots:
215216
import dataclasses
216217

218+
assert self.current_worktree is not None
217219
original_git_root = git_root_dir()
218220
file_to_funcs, count, trace = result
219221
remapped: dict[Path, list[FunctionToOptimize]] = {}

0 commit comments

Comments
 (0)