Skip to content

Commit

Permalink
Get rid of Optional[Any].
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock committed Nov 1, 2023
1 parent 2e88194 commit 96fcc3e
Show file tree
Hide file tree
Showing 19 changed files with 178 additions and 177 deletions.
36 changes: 18 additions & 18 deletions opensearchpy/_async/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
from __future__ import unicode_literals

import logging
from typing import Any, Optional, Type
from typing import Any, Type

from ..transport import AsyncTransport, TransportError
from .cat import CatClient
Expand Down Expand Up @@ -357,7 +357,7 @@ async def index(
self,
index: Any,
body: Any,
id: Optional[Any] = None,
id: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
Expand Down Expand Up @@ -420,7 +420,7 @@ async def index(
async def bulk(
self,
body: Any,
index: Optional[Any] = None,
index: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
Expand Down Expand Up @@ -470,7 +470,7 @@ async def bulk(
async def clear_scroll(
self,
body: Any = None,
scroll_id: Optional[Any] = None,
scroll_id: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
Expand Down Expand Up @@ -512,7 +512,7 @@ async def clear_scroll(
async def count(
self,
body: Any = None,
index: Optional[Any] = None,
index: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
Expand Down Expand Up @@ -970,7 +970,7 @@ async def explain(
async def field_caps(
self,
body: Any = None,
index: Optional[Any] = None,
index: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
Expand Down Expand Up @@ -1143,7 +1143,7 @@ async def get_source(
async def mget(
self,
body: Any,
index: Optional[Any] = None,
index: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
Expand Down Expand Up @@ -1194,7 +1194,7 @@ async def mget(
async def msearch(
self,
body: Any,
index: Optional[Any] = None,
index: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
Expand Down Expand Up @@ -1252,7 +1252,7 @@ async def msearch(
async def msearch_template(
self,
body: Any,
index: Optional[Any] = None,
index: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
Expand Down Expand Up @@ -1306,7 +1306,7 @@ async def msearch_template(
async def mtermvectors(
self,
body: Any = None,
index: Optional[Any] = None,
index: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
Expand Down Expand Up @@ -1361,7 +1361,7 @@ async def put_script(
self,
id: Any,
body: Any,
context: Optional[Any] = None,
context: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
Expand Down Expand Up @@ -1397,7 +1397,7 @@ async def put_script(
async def rank_eval(
self,
body: Any,
index: Optional[Any] = None,
index: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
Expand Down Expand Up @@ -1512,7 +1512,7 @@ async def reindex_rethrottle(
async def render_search_template(
self,
body: Any = None,
id: Optional[Any] = None,
id: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
Expand Down Expand Up @@ -1556,7 +1556,7 @@ async def scripts_painless_execute(
async def scroll(
self,
body: Any = None,
scroll_id: Optional[Any] = None,
scroll_id: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
Expand Down Expand Up @@ -1631,7 +1631,7 @@ async def scroll(
async def search(
self,
body: Any = None,
index: Optional[Any] = None,
index: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
Expand Down Expand Up @@ -1756,7 +1756,7 @@ async def search(
)
async def search_shards(
self,
index: Optional[Any] = None,
index: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
Expand Down Expand Up @@ -1803,7 +1803,7 @@ async def search_shards(
async def search_template(
self,
body: Any,
index: Optional[Any] = None,
index: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
Expand Down Expand Up @@ -1872,7 +1872,7 @@ async def termvectors(
self,
index: Any,
body: Any = None,
id: Optional[Any] = None,
id: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
Expand Down
26 changes: 13 additions & 13 deletions opensearchpy/_async/client/cat.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
# -----------------------------------------------------


from typing import Any, Optional
from typing import Any

from .utils import NamespacedClient, _make_path, query_params

Expand All @@ -45,7 +45,7 @@ class CatClient(NamespacedClient):
@query_params("expand_wildcards", "format", "h", "help", "local", "s", "v")
async def aliases(
self,
name: Optional[Any] = None,
name: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
Expand Down Expand Up @@ -99,7 +99,7 @@ async def all_pit_segments(
)
async def allocation(
self,
node_id: Optional[Any] = None,
node_id: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
Expand Down Expand Up @@ -175,7 +175,7 @@ async def cluster_manager(
@query_params("format", "h", "help", "s", "v")
async def count(
self,
index: Optional[Any] = None,
index: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
Expand All @@ -201,7 +201,7 @@ async def count(
@query_params("bytes", "format", "h", "help", "s", "v")
async def fielddata(
self,
fields: Optional[Any] = None,
fields: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
Expand Down Expand Up @@ -290,7 +290,7 @@ async def help(
)
async def indices(
self,
index: Optional[Any] = None,
index: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
Expand Down Expand Up @@ -564,7 +564,7 @@ async def plugins(
)
async def recovery(
self,
index: Optional[Any] = None,
index: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
Expand Down Expand Up @@ -647,7 +647,7 @@ async def repositories(
)
async def segment_replication(
self,
index: Optional[Any] = None,
index: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
Expand Down Expand Up @@ -696,7 +696,7 @@ async def segment_replication(
)
async def segments(
self,
index: Optional[Any] = None,
index: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
Expand Down Expand Up @@ -739,7 +739,7 @@ async def segments(
)
async def shards(
self,
index: Optional[Any] = None,
index: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
Expand Down Expand Up @@ -785,7 +785,7 @@ async def shards(
)
async def thread_pool(
self,
thread_pool_patterns: Optional[Any] = None,
thread_pool_patterns: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
Expand Down Expand Up @@ -832,7 +832,7 @@ async def thread_pool(
)
async def snapshots(
self,
repository: Optional[Any] = None,
repository: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
Expand Down Expand Up @@ -924,7 +924,7 @@ async def tasks(
)
async def templates(
self,
name: Optional[Any] = None,
name: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
Expand Down
12 changes: 6 additions & 6 deletions opensearchpy/_async/client/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
# -----------------------------------------------------


from typing import Any, Optional
from typing import Any

from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params

Expand All @@ -59,7 +59,7 @@ class ClusterClient(NamespacedClient):
)
async def health(
self,
index: Optional[Any] = None,
index: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
Expand Down Expand Up @@ -141,8 +141,8 @@ async def pending_tasks(
)
async def state(
self,
metric: Optional[Any] = None,
index: Optional[Any] = None,
metric: Any = None,
index: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
Expand Down Expand Up @@ -190,7 +190,7 @@ async def state(
@query_params("flat_settings", "timeout")
async def stats(
self,
node_id: Optional[Any] = None,
node_id: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
Expand Down Expand Up @@ -389,7 +389,7 @@ async def delete_component_template(
@query_params("cluster_manager_timeout", "local", "master_timeout")
async def get_component_template(
self,
name: Optional[Any] = None,
name: Any = None,
params: Any = None,
headers: Any = None,
) -> Any:
Expand Down
Loading

0 comments on commit 96fcc3e

Please sign in to comment.