-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[py] Fix : Mypy type annotation errors - 2 #15848
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
[py] Fix : Mypy type annotation errors - 2 #15848
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 5eec4b8
Previous suggestions✅ Suggestions up to commit e75da48
|
Hi @cgoldberg, please review my PR (I have added a few more files in this PR) |
@ShauryaDusht another PR (#15847) is resolving the type errors for |
Will remove |
@ShauryaDusht I don't think silently defaulting to a value (like an empty string) when the value is not found is a good idea. This will introduce uncertainty and does not conform to the BiDi spec. So, we should do something like this: default_value = json.get("defaultValue")
if default_value is not None and not isinstance(default_value, str):
raise ValueError("defaultValue must be a string if provided") Same with other classes and params. |
Hi @navin772 |
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.
@ShauryaDusht I have made some changes as per the BiDi spec.
LGTM!
Thanks for the changes and review |
User description
🔧 What does this PR do?
This PR fixes several type annotation errors reported by Mypy in the following files:
selenium/webdriver/common/bidi/browser.py
- changes reverted to avoid conflict from another PR fixed errors in browser.py for 15697 #15847selenium/webdriver/common/bidi/browsing_context.py
selenium/webdriver/common/action_chains.py
- recently addedselenium/webdriver/common/utils.py
- recently added💡 Additional Notes
🔄 Types of changes
PR Type
Bug fix, Enhancement