Skip to content

Commit cbb112d

Browse files
jeremymanningclaude
andcommitted
Fix mypy type errors in notebook_magic.py
- Fix incompatible types in assignment by using separate variable for Path object - Resolve "str has no attribute exists/is_dir" errors in detect_config_files - Maintain functionality while ensuring proper type safety 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 89e999a commit cbb112d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clustrix/notebook_magic.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,10 +351,10 @@ def detect_config_files(search_dirs: Optional[List[str]] = None) -> List[Path]:
351351
config_files = []
352352
config_names = ["clustrix.yml", "clustrix.yaml", "config.yml", "config.yaml"]
353353
for dir_path in search_dirs:
354-
dir_path = Path(dir_path).expanduser()
355-
if dir_path.exists() and dir_path.is_dir():
354+
path_obj = Path(dir_path).expanduser()
355+
if path_obj.exists() and path_obj.is_dir():
356356
for config_name in config_names:
357-
config_path = dir_path / config_name
357+
config_path = path_obj / config_name
358358
if config_path.exists() and config_path.is_file():
359359
config_files.append(config_path)
360360
return config_files

0 commit comments

Comments
 (0)