Skip to content

Commit 2434f27

Browse files
Update graphgen/operators/read/read_files.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent f487673 commit 2434f27

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

graphgen/operators/read/read_files.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@
99
}
1010

1111

12-
def read_files(file_path: str, cache_dir: str) -> list[dict]:
12+
def read_files(file_path: str, cache_dir: str | None = None) -> list[dict]:
1313
suffix = file_path.split(".")[-1].lower()
1414
if suffix == "pdf":
15-
reader = _MAPPING[suffix](output_dir=cache_dir)
15+
if cache_dir is not None:
16+
reader = _MAPPING[suffix](output_dir=cache_dir)
17+
else:
18+
reader = _MAPPING[suffix]()
1619
elif suffix in _MAPPING:
1720
reader = _MAPPING[suffix]()
1821
else:

0 commit comments

Comments
 (0)