Merge .pyi type stubs inline (#563)
* Merged types into .py code. Signed-off-by: dblock <dblock@amazon.com> * Fix: nox -rs generate. Signed-off-by: dblock <dblock@amazon.com> * Updated CHANGELOG. Signed-off-by: dblock <dblock@amazon.com> * Use lowest common python version for lint. Signed-off-by: dblock <dblock@amazon.com> * Fix: don't typeshed. Signed-off-by: dblock <dblock@amazon.com> * Removed unneeded comment. Signed-off-by: dblock <dblock@amazon.com> * Simplify OPENSEARCH_URL. Signed-off-by: dblock <dblock@amazon.com> * Fix: positional ignore_status used as chunk_size. Signed-off-by: dblock <dblock@amazon.com> * Fix: parse version string. Signed-off-by: dblock <dblock@amazon.com> * Remove future annotations for Python 3.6. Signed-off-by: dblock <dblock@amazon.com> * Fix: types in documentation. Signed-off-by: dblock <dblock@amazon.com> * Improve CHANGELOG text. Signed-off-by: dblock <dblock@amazon.com> * Re-added missing separator. Signed-off-by: dblock <dblock@amazon.com> * Remove duplicate licenses. Signed-off-by: dblock <dblock@amazon.com> * Get rid of Optional[Any]. Signed-off-by: dblock <dblock@amazon.com> * Fix docs with AsyncOpenSearch. Signed-off-by: dblock <dblock@amazon.com> * Fix: undo comment. Signed-off-by: dblock <dblock@amazon.com> --------- Signed-off-by: dblock <dblock@amazon.com>
This commit is contained in:
committed by
GitHub
parent
0d8a23dd78
commit
dcb79cc322
@@ -22,7 +22,7 @@ index_name = "test-index-async"
|
||||
item_count = 100
|
||||
|
||||
|
||||
async def index_records(client, item_count):
|
||||
async def index_records(client, item_count) -> None:
|
||||
await asyncio.gather(
|
||||
*[
|
||||
client.index(
|
||||
@@ -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:
|
||||
loop = asyncio.new_event_loop()
|
||||
asyncio.set_event_loop(loop)
|
||||
loop.run_until_complete(test_async(item_count, client_count))
|
||||
loop.close()
|
||||
|
||||
|
||||
def test_1():
|
||||
def test_1() -> None:
|
||||
test(1, 32 * item_count)
|
||||
|
||||
|
||||
def test_2():
|
||||
def test_2() -> None:
|
||||
test(2, 16 * item_count)
|
||||
|
||||
|
||||
def test_4():
|
||||
def test_4() -> None:
|
||||
test(4, 8 * item_count)
|
||||
|
||||
|
||||
def test_8():
|
||||
def test_8() -> None:
|
||||
test(8, 4 * item_count)
|
||||
|
||||
|
||||
def test_16():
|
||||
def test_16() -> None:
|
||||
test(16, 2 * item_count)
|
||||
|
||||
|
||||
def test_32():
|
||||
def test_32() -> None:
|
||||
test(32, item_count)
|
||||
|
||||
|
||||
|
||||
@@ -75,23 +75,23 @@ def test(thread_count=1, request_count=1, client_count=1):
|
||||
print(f"latency={latency}")
|
||||
|
||||
|
||||
def test_1():
|
||||
def test_1() -> None:
|
||||
test(1, 32 * request_count, 1)
|
||||
|
||||
|
||||
def test_2():
|
||||
def test_2() -> None:
|
||||
test(2, 16 * request_count, 2)
|
||||
|
||||
|
||||
def test_4():
|
||||
def test_4() -> None:
|
||||
test(4, 8 * request_count, 3)
|
||||
|
||||
|
||||
def test_8():
|
||||
def test_8() -> None:
|
||||
test(8, 4 * request_count, 8)
|
||||
|
||||
|
||||
def test_32():
|
||||
def test_32() -> None:
|
||||
test(32, request_count, 32)
|
||||
|
||||
|
||||
|
||||
@@ -112,23 +112,23 @@ def test(thread_count=1, item_count=1, client_count=1):
|
||||
print(f"{count}, latency={latency}")
|
||||
|
||||
|
||||
def test_1():
|
||||
def test_1() -> None:
|
||||
test(1, 32 * item_count, 1)
|
||||
|
||||
|
||||
def test_2():
|
||||
def test_2() -> None:
|
||||
test(2, 16 * item_count, 2)
|
||||
|
||||
|
||||
def test_4():
|
||||
def test_4() -> None:
|
||||
test(4, 8 * item_count, 3)
|
||||
|
||||
|
||||
def test_8():
|
||||
def test_8() -> None:
|
||||
test(8, 4 * item_count, 8)
|
||||
|
||||
|
||||
def test_32():
|
||||
def test_32() -> None:
|
||||
test(32, item_count, 32)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user