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:
@@ -30,7 +30,7 @@ from __future__ import unicode_literals
|
||||
from typing import Any, Dict
|
||||
|
||||
|
||||
def create_flat_git_index(client, index):
|
||||
def create_flat_git_index(client: Any, index: Any) -> None:
|
||||
# we will use user on several places
|
||||
user_mapping = {
|
||||
"properties": {"name": {"type": "text", "fields": {"raw": {"type": "keyword"}}}}
|
||||
@@ -73,7 +73,7 @@ def create_flat_git_index(client, index):
|
||||
)
|
||||
|
||||
|
||||
def create_git_index(client, index):
|
||||
def create_git_index(client: Any, index: Any) -> None:
|
||||
# we will use user on several places
|
||||
user_mapping = {
|
||||
"properties": {"name": {"type": "text", "fields": {"raw": {"type": "keyword"}}}}
|
||||
@@ -1095,7 +1095,7 @@ DATA = [
|
||||
]
|
||||
|
||||
|
||||
def flatten_doc(d) -> Dict[str, Any]:
|
||||
def flatten_doc(d: Any) -> Dict[str, Any]:
|
||||
src = d["_source"].copy()
|
||||
del src["commit_repo"]
|
||||
return {"_index": "flat-git", "_id": d["_id"], "_source": src}
|
||||
@@ -1104,7 +1104,7 @@ def flatten_doc(d) -> Dict[str, Any]:
|
||||
FLAT_DATA = [flatten_doc(d) for d in DATA if "routing" in d]
|
||||
|
||||
|
||||
def create_test_git_data(d) -> Dict[str, Any]:
|
||||
def create_test_git_data(d: Any) -> Dict[str, Any]:
|
||||
src = d["_source"].copy()
|
||||
return {
|
||||
"_index": "test-git",
|
||||
|
||||
Reference in New Issue
Block a user