-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Fix type error for attribute in remote_connection.py #15810
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
Fix type error for attribute in remote_connection.py #15810
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
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... Can you please sign the CLA? #15810 (comment)
btw, you can ignore the comment from AI bot complaining about the missing import.. I have no idea what it's talking about :)
Sounds good, do I need to manually ignore it or do you just mean for reference? Aso, I signed the CLA as requested :) |
thanks
no, you don't need to do anything. I just meant don't be alarmed that it left an irrelevant comment on your PR. |
@cgoldberg How can I address the CI - RBE tests error? Should I increase the timeout to see if it helps? Or is there something else I should do to get it passing? |
@Bradltr95 neither of those failures look related to your PR. Unfortunately we have a few flaky tests. I just kicked off CI again to see if it passes, but don't worry about it.. your PR looks fine. I'll keep my eye on the CI runs and merge your change in a little while. p.s. if you want to try to make those tests more robust, that would be great.. but do it in a separate PR |
All tests passed. Thanks for your first Selenium contribution! |
User description
💥 What does this PR do?
This update resolves type inconsistencies related to the browser_name variable in
webdriver/remote/remote_connection.py
. Previously, browser_name was initialized with None, while other parts of the codebase expected it to always be a str, leading to mypy errors such as:error: Argument "browser_name" to "ChromiumRemoteConnection" has incompatible type "str | None"; expected "str"
Fix
The fix involves updating the type annotation of browser_name to Optional[str], aligning with its usage and ensuring compatibility with static type checking. This change eliminates related type errors and moves the codebase closer to full mypy compliance.
PR Type
Bug fix
Description
Fixes type annotation for
browser_name
inremote_connection.py
Changes
browser_name
toOptional[str]
to resolve Mypy errorsAddresses part of the static typing issues in Python bindings
Changes walkthrough 📝
remote_connection.py
Correct type annotation for browser_name attribute
py/selenium/webdriver/remote/remote_connection.py
browser_name
attribute type toOptional[str]