Conversation
Co-authored-by: abhimehro <84992105+abhimehro@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Merging to
|
|
👋 Development Partner is reviewing this PR. Will provide feedback shortly. |
Summary of ChangesHello @abhimehro, 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 significantly improves the user experience by integrating ETA into command-line progress bars, which helps manage user expectations during potentially lengthy background tasks. Concurrently, it addresses and rectifies a critical syntax issue in a data validation function, ensuring the application's stability and correct operation. Highlights
Changelog
Activity
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.
Code Review
This pull request introduces a helpful ETA display for progress bars, improving user experience during long operations. It also includes a critical fix for a syntax error in validate_folder_data. The implementation is well-done. I have one minor suggestion to simplify the time formatting logic for the ETA for better readability and maintainability.
| eta_seconds = int(remaining / rate) | ||
| minutes, seconds = divmod(eta_seconds, 60) | ||
| if minutes >= 60: | ||
| hours, minutes = divmod(minutes, 60) | ||
| eta_str = f" — ETA: {hours}h {minutes:02d}m" | ||
| else: | ||
| eta_str = f" — ETA: {minutes:02d}m {seconds:02d}s" |
There was a problem hiding this comment.
The logic for formatting the ETA string can be simplified to be more direct and slightly more efficient. Instead of calculating total minutes and then deriving hours, you can directly check if the total seconds exceed an hour's worth of seconds and format accordingly. This also avoids calculating seconds when the ETA is over an hour and they are not displayed.
| eta_seconds = int(remaining / rate) | |
| minutes, seconds = divmod(eta_seconds, 60) | |
| if minutes >= 60: | |
| hours, minutes = divmod(minutes, 60) | |
| eta_str = f" — ETA: {hours}h {minutes:02d}m" | |
| else: | |
| eta_str = f" — ETA: {minutes:02d}m {seconds:02d}s" | |
| eta_seconds = int(remaining / rate) | |
| if eta_seconds >= 3600: | |
| hours, remainder = divmod(eta_seconds, 3600) | |
| minutes, _ = divmod(remainder, 60) | |
| eta_str = f" — ETA: {hours}h {minutes:02d}m" | |
| else: | |
| minutes, seconds = divmod(eta_seconds, 60) | |
| eta_str = f" — ETA: {minutes:02d}m {seconds:02d}s" |
| # Use \033[K to clear line residue | ||
| sys.stderr.write( | ||
| f"\r\033[K{Colors.CYAN}{prefix} {label}: [{bar}] {percent}% ({current}/{total}){Colors.ENDC}" | ||
| f"\r\033[K{Colors.CYAN}{prefix} {label}: [{bar}] {percent}% ({current}/{total}){eta_str}{Colors.ENDC}" |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Line too long (110/100) Warning
| render_progress_bar( | ||
| 0, total, "Warming up cache", prefix="⏳", start_time=start_time | ||
| ) | ||
|
|
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Line too long (120/100) Warning
|
|
||
| def render_progress_bar( | ||
| current: int, total: int, label: str, prefix: str = "🚀" | ||
| current: int, |
Check warning
Code scanning / Pylint (reported by Codacy)
Wrong hanging indentation before block (add 4 spaces). Warning
| def render_progress_bar( | ||
| current: int, total: int, label: str, prefix: str = "🚀" | ||
| current: int, | ||
| total: int, |
Check warning
Code scanning / Pylint (reported by Codacy)
Wrong hanging indentation before block (add 4 spaces). Warning
| current: int, total: int, label: str, prefix: str = "🚀" | ||
| current: int, | ||
| total: int, | ||
| label: str, |
Check warning
Code scanning / Pylint (reported by Codacy)
Wrong hanging indentation before block (add 4 spaces). Warning
| current: int, | ||
| total: int, | ||
| label: str, | ||
| prefix: str = "🚀", |
Check warning
Code scanning / Pylint (reported by Codacy)
Wrong hanging indentation before block (add 4 spaces). Warning
| total: int, | ||
| label: str, | ||
| prefix: str = "🚀", | ||
| start_time: Optional[float] = None, |
Check warning
Code scanning / Pylint (reported by Codacy)
Wrong hanging indentation before block (add 4 spaces). Warning
| # Use \033[K to clear line residue | ||
| sys.stderr.write( | ||
| f"\r\033[K{Colors.CYAN}{prefix} {label}: [{bar}] {percent}% ({current}/{total}){Colors.ENDC}" | ||
| f"\r\033[K{Colors.CYAN}{prefix} {label}: [{bar}] {percent}% ({current}/{total}){eta_str}{Colors.ENDC}" |
Check warning
Code scanning / Pylint (reported by Codacy)
Line too long (110/100) Warning
| render_progress_bar( | ||
| 0, total, "Warming up cache", prefix="⏳", start_time=start_time | ||
| ) | ||
|
|
Check warning
Code scanning / Pylint (reported by Codacy)
Line too long (120/100) Warning
|
🤖 Automated PR Review — Closing due to merge conflict This PR has a merge conflict with |
Understood. Acknowledging that the previous work had a merge conflict and the syntax error was resolved on main. I will create a fresh PR for the ETA progress bar feature. |
validate_folder_data.— ETA: 00m 05s.PR created automatically by Jules for task 6933896620626637858 started by @abhimehro