[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 |
navin772
left a comment
There was a problem hiding this comment.
@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.pyselenium/webdriver/common/action_chains.py- recently addedselenium/webdriver/common/utils.py- recently added💡 Additional Notes
🔄 Types of changes
PR Type
Bug fix, Enhancement