Expanded type coverage to benchmarks, samples and tests. (#566)
* Renamed json samples to fix duplicate module name. Signed-off-by: dblock <[email protected]> * Enabled mypy on all source files. Signed-off-by: dblock <[email protected]> * Added missing types. Signed-off-by: dblock <[email protected]> * Added CHANGELOG. Signed-off-by: dblock <[email protected]> * Move type: ignore to fix untyped decorator makes function untyped. Signed-off-by: dblock <[email protected]> * Fix nox -rs lint-3.7. Signed-off-by: dblock <[email protected]> * Fixed incorrect import. Signed-off-by: dblock <[email protected]> * Fix broken test. Signed-off-by: dblock <[email protected]> * Fixed TestBulk::test_bulk_works_with_bytestring_body. Signed-off-by: dblock <[email protected]> --------- Signed-off-by: dblock <[email protected]>
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
|
||||
|
||||
import os
|
||||
from typing import Any
|
||||
|
||||
from opensearchpy import OpenSearch
|
||||
|
||||
@@ -45,7 +46,7 @@ if not client.indices.exists(index_name):
|
||||
)
|
||||
|
||||
# index data
|
||||
data = []
|
||||
data: Any = []
|
||||
for i in range(100):
|
||||
data.append({"index": {"_index": index_name, "_id": i}})
|
||||
data.append({"value": i})
|
||||
|
||||
@@ -16,7 +16,7 @@ import asyncio
|
||||
from opensearchpy import AsyncOpenSearch
|
||||
|
||||
|
||||
async def main():
|
||||
async def main() -> None:
|
||||
# connect to OpenSearch
|
||||
host = "localhost"
|
||||
port = 9200
|
||||
|
||||
@@ -16,7 +16,7 @@ import asyncio
|
||||
from opensearchpy import AsyncOpenSearch
|
||||
|
||||
|
||||
async def main():
|
||||
async def main() -> None:
|
||||
# connect to OpenSearch
|
||||
host = "localhost"
|
||||
port = 9200
|
||||
@@ -18,7 +18,7 @@ import random
|
||||
from opensearchpy import AsyncHttpConnection, AsyncOpenSearch, helpers
|
||||
|
||||
|
||||
async def main():
|
||||
async def main() -> None:
|
||||
# connect to an instance of OpenSearch
|
||||
host = os.getenv("HOST", default="localhost")
|
||||
port = int(os.getenv("PORT", 9200))
|
||||
|
||||
Reference in New Issue
Block a user