-
Notifications
You must be signed in to change notification settings - Fork 345
chore: dedent deprecation warning message #1932
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
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @akx, 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 refines the formatting of a Python end-of-life deprecation warning message. By removing leading indentation and applying the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. 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 removes indentation and leading/trailing whitespace from a deprecation warning message to make it easier to filter. The change is applied to two files where the message is duplicated. While the change is effective, I've suggested an alternative way to define the string using string literal concatenation. This improves readability by allowing indentation in the source code and results in a single-line message, which is often even easier to filter and handle in logs. Additionally, this warning message and the logic to display it are duplicated in google/auth/__init__.py and google/oauth2/__init__.py. To improve maintainability, consider refactoring this into a shared utility in a future change.
|
Good point from Gemini – changed to an implicitly concatenated string. |
|
Is this in response to something that is explicitly broken? If not, I recommend we close this OR create an Issue and deal with it later. Why? We have a chicken or the egg issue due to the fact that so many of our repos import from our other repos as dependencies. And in every case where repo A issues some form of warning, each of our other repos B, C, D, E, ... must filter out the warning and vice versa. So anytime we change a warning, we have to update all the filterwarnings OR if we change the filterwarnings we have to then change the warning text across multiple libraries. We had this exact thing happen several days again with one of our other repos balking because of a mod to a warning string. These minor breakages encroach on our time to add features, etc. We have been considering this issue and I think we need a global solution with standardized warning messages and robust regex filters across all our repositories. I don't think that should start here, especially since:
|
Yep, it's broken in that you need to jump through hoops (figuring out a Applying this patch makes it possible to use a simpler syntax for
This warning only began existing last week in 25f4ca6, shipped in v2.47.0. (A differently spelled warning has existed for a longer time in googleapis/python-api-core#832, but even that has only been shipped in 3 versions of that package (2.28.0, 2.28.1, 2.29.0)). |
|
Thanks for this feedback. This provides valuable context that I did not have. I'm re-reviewing your suggested fix now. I need to validate it against our other managed repos to ensure there aren't any regressions, but I'll update you here as soon as I have a clear path forward. Thanks for the patience!" |
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.
Thanks!
Edit: Sorry Chalmer, didn't see you were looking at this. I'll leave my approval though, since it needs multi-approvers anyway
The indentation and leading/trailing newlines made it a little harder than necessary to
filterwarningsthe deprecation warning.(For instance, for pytest's filterwarnings, you'd need
"ignore:\\s+You are using a Python version 3.8:FutureWarning",...)