-
Notifications
You must be signed in to change notification settings - Fork 183
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
Merge .pyi
type stubs inline
#563
Conversation
Signed-off-by: dblock <[email protected]>
Signed-off-by: dblock <[email protected]>
Signed-off-by: dblock <[email protected]>
Signed-off-by: dblock <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #563 +/- ##
==========================================
+ Coverage 71.10% 71.69% +0.58%
==========================================
Files 85 87 +2
Lines 7774 7875 +101
==========================================
+ Hits 5528 5646 +118
+ Misses 2246 2229 -17
|
Signed-off-by: dblock <[email protected]>
Signed-off-by: dblock <[email protected]>
Signed-off-by: dblock <[email protected]>
Signed-off-by: dblock <[email protected]>
Signed-off-by: dblock <[email protected]>
Signed-off-by: dblock <[email protected]>
Signed-off-by: dblock <[email protected]>
Signed-off-by: dblock <[email protected]>
Signed-off-by: dblock <[email protected]>
Signed-off-by: dblock <[email protected]>
Signed-off-by: dblock <[email protected]>
Signed-off-by: dblock <[email protected]>
@saimedhi this is ready for review, FYI |
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.
@dblock, I've reviewed the PR, and from what I understand, API types are added automatically through the generator, while for tests and other files, we add them manually. I've made a few requested changes, and if you agree with them, please make the changes. Thank you for your contribution!
@@ -71,34 +71,34 @@ async def test_async(client_count=1, item_count=1): | |||
await asyncio.gather(*[client.close() for client in clients]) | |||
|
|||
|
|||
def test(item_count=1, client_count=1): | |||
def test(item_count: int = 1, client_count: int = 1) -> None: |
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.
type annotation missing for "test_async" function in this file.
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.
There's another 1000 errors from the missing files that were not previously checked by mypy, including benchmarks and tests. Could we merge this one and I'll work on the rest?
Signed-off-by: dblock <[email protected]>
The new opensearch-py 2.4.1 added mypy stubs in opensearch-project/opensearch-py#563 and they detected an error in our example (and they cause mypy error when the new version is used)
The new opensearch-py 2.4.1 added mypy stubs in opensearch-project/opensearch-py#563 and they detected an error in our example (and they cause mypy error when the new version is used)
* Merged types into .py code. Signed-off-by: dblock <[email protected]> * Fix: nox -rs generate. Signed-off-by: dblock <[email protected]> * Updated CHANGELOG. Signed-off-by: dblock <[email protected]> * Use lowest common python version for lint. Signed-off-by: dblock <[email protected]> * Fix: don't typeshed. Signed-off-by: dblock <[email protected]> * Removed unneeded comment. Signed-off-by: dblock <[email protected]> * Simplify OPENSEARCH_URL. Signed-off-by: dblock <[email protected]> * Fix: positional ignore_status used as chunk_size. Signed-off-by: dblock <[email protected]> * Fix: parse version string. Signed-off-by: dblock <[email protected]> * Remove future annotations for Python 3.6. Signed-off-by: dblock <[email protected]> * Fix: types in documentation. Signed-off-by: dblock <[email protected]> * Improve CHANGELOG text. Signed-off-by: dblock <[email protected]> * Re-added missing separator. Signed-off-by: dblock <[email protected]> * Remove duplicate licenses. Signed-off-by: dblock <[email protected]> * Get rid of Optional[Any]. Signed-off-by: dblock <[email protected]> * Fix docs with AsyncOpenSearch. Signed-off-by: dblock <[email protected]> * Fix: undo comment. Signed-off-by: dblock <[email protected]> --------- Signed-off-by: dblock <[email protected]> Signed-off-by: roma2023 <[email protected]>
The new opensearch-py 2.4.1 added mypy stubs in opensearch-project/opensearch-py#563 and they detected an error in our example (and they cause mypy error when the new version is used) GitOrigin-RevId: dffe04ada4c05a3e29422f6ea92625c6e040bf10
The new opensearch-py 2.4.1 added mypy stubs in opensearch-project/opensearch-py#563 and they detected an error in our example (and they cause mypy error when the new version is used) GitOrigin-RevId: dffe04ada4c05a3e29422f6ea92625c6e040bf10
The new opensearch-py 2.4.1 added mypy stubs in opensearch-project/opensearch-py#563 and they detected an error in our example (and they cause mypy error when the new version is used) GitOrigin-RevId: dffe04ada4c05a3e29422f6ea92625c6e040bf10
Description
Merge .pyi files inline for those files that were previously covered by mypy. Many
Any
that should not be, but it gets us started to have a fully typed library that is edited at the same time as code. This should greatly improve code clarity, maintainability, and enable better static analysis.I wasn't sure whether this is a good idea, so I found some other projects merging stubs.
Issues Resolved
Closes #536.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.