Skip to content

Conversation

onlineinfoh
Copy link

Fixes syntax error in f-string on line 273 of client.py that was preventing SDK from loading.

Copy link

Summary of Changes

Hello @onlineinfoh, 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 resolves a critical syntax error in an f-string located within the client.py file. The issue, caused by incorrect quote usage, was preventing the SDK from initializing properly. The fix ensures the SDK can now load and function as intended, restoring stability to the client module.

Highlights

  • F-string Syntax Correction: An f-string on line 273 of mantis_sdk/client.py was corrected. The original code used nested double quotes within the f-string, leading to a SyntaxError and preventing the SDK from loading. This has been resolved by using single quotes for the dictionary keys inside the f-string.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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 correctly fixes a SyntaxError in an f-string within client.py. The change is effective in resolving the bug that prevented the SDK from loading. I have one suggestion to further improve the code by using the logging module for progress reporting instead of print(), which is a standard best practice for libraries to allow users to control output.


if progress["progress"] != previous_progress:
print(f"{progress["progress"]}% - {progress['message']}")
print(f"{progress['progress']}% - {progress['message']}")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While this change correctly fixes the f-string syntax error, it's generally better practice for a library (SDK) to use logging instead of print() for output.1 Using the configured logger allows the user of the SDK to control the verbosity and destination of the output. I suggest using logger.info here for progress messages, which seems more appropriate than print() given that a logger is already in use in this file.

Suggested change
print(f"{progress['progress']}% - {progress['message']}")
logger.info(f"{progress['progress']}% - {progress['message']}")

Style Guide References

Footnotes

  1. In library code, it is recommended to use the logging module for all event logging, including informational messages, warnings, and errors. Avoid using print() as it writes to standard output and is not easily configurable by the application that imports and uses the library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant