-
Notifications
You must be signed in to change notification settings - Fork 63
fix: change cache_dir in read operator to working_dir #136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Summary of ChangesHello @ChenZiHong-Gavin, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on enhancing the clarity and consistency of the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request renames the cache_dir parameter to working_dir in the read function for better clarity. The changes are straightforward, but I have a couple of suggestions to improve the documentation and make the refactoring more consistent within the read.py file.
| :param input_path: File or directory path(s) to read from | ||
| :param allowed_suffix: List of allowed file suffixes (e.g., ['pdf', 'txt']) | ||
| :param cache_dir: Directory to cache intermediate files (PDF processing) | ||
| :param working_dir: Directory to cache intermediate files (PDF processing) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docstring for working_dir mentions only "PDF processing". However, this directory is also used by ParallelFileScanner for caching file scan results. To make the documentation more accurate, I suggest updating it to reflect its broader usage.
| :param working_dir: Directory to cache intermediate files (PDF processing) | |
| :param working_dir: Directory for caching intermediate files (e.g., for file scanning and PDF processing) |
| read_tasks = [] | ||
| for suffix, file_paths in files_by_suffix.items(): | ||
| reader = _build_reader(suffix, cache_dir, **reader_kwargs) | ||
| reader = _build_reader(suffix, working_dir, **reader_kwargs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While you've correctly passed working_dir to _build_reader, the parameter in the _build_reader function definition is still named cache_dir. For better consistency and to complete the refactoring within this file, consider renaming the cache_dir parameter to working_dir in the _build_reader function signature and its body as well. This would improve internal consistency and readability.
This PR renames the
cache_dirparameter toworking_dirin theread()operator function for consistency and clarity,