-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[py] correct type annotations of default-None params #15341
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
Conversation
Used regex for search: : \w+ = None
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Is this still relevant? |
Yes of coures it is still relevant. It's type hints. Not sure why it's taken so long to deal with |
It's a community project run by volunteers who put in a lot of effort and get paid nothing. We are pretty diligent with reviewing contributions, but not everything gets immediate attention. |
Let me know if I can help expedite things! There's no logic changes or anything, so it shouldn't take much to review |
This is causing test failures. I can reproduce when using your branch:
Can you take a look? |
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.
fix TypeError
My bad, tiny mistake in my haste. Fixed! Can you please re-run CI? |
CI failed, but it wasn't related to these changes... We have a flaky test. I'm running it again. |
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.
@DeflateAwning
CI is green and this looks good to go.
Thanks for the contribution!
Thanks a lot! Really appreciate it! |
User description
Corrected type hints/annotations, mostly of arguments with default values of
None
.Also added a few entirely-missing type hints, mostly for strings.
Motivation and Context
Pyright type checker was throwing errors in many of these cases.
Types of changes
Checklist
None of the other checklist items are required.
Recommend a squash merge.
PR Type
Bug fix, Enhancement
Description
Corrected type annotations for parameters with default
None
values.Added missing type hints, primarily for strings and lists.
Improved type safety by using
Optional
and explicit type declarations.Enhanced code clarity and compatibility with type checkers like Pyright.
Changes walkthrough 📝
18 files
Updated type hints for `log_output` parameter.
Added `Optional` type hints for `options` and `service`.
Corrected type hints for
executable_path
,log_output
, anddriver_path_env_key
.Added `Optional` type hints for multiple parameters.
Updated type hint for `source` parameter.
Corrected type hints for multiple parameters including `log_output`.
Updated type hints for
executable_path
,log_output
, anddriver_path_env_key
.Added `Optional` type hints for `options` and `service`.
Corrected type hints for
executable_path
,log_output
, anddriver_path_env_key
.Added `Optional` type hints for `options` and `service`.
Updated type hints for
executable_path
,log_output
, anddriver_path_env_key
.Added `Optional` type hints for `options` and `service`.
Added `Optional` type hint for `_client_config`.
Corrected type hints for `executable_path` and `driver_path_env_key`.
Added `Optional` type hints for `options` and `service`.
Updated type hint for `execute_script` method.
Added `Optional` type hint for `service` parameter.
Added `Optional` type hint for `service` parameter.
2 files
Added type hints for `arguments` and `add_argument` methods.
Enhanced type hints for `execute` and `execute_script` methods.