Skip to content

Commit eed7609

Browse files
committed
use cast for TypedDict
1 parent 51c2982 commit eed7609

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pinecone/db_data/resources/sync/namespace_request_factory.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Optional, TypedDict, Any
1+
from typing import Optional, TypedDict, Any, cast
22

33
from pinecone.utils import parse_non_empty_args
44

@@ -16,13 +16,15 @@ class NamespaceRequestFactory:
1616
def describe_namespace_args(namespace: str, **kwargs) -> DescribeNamespaceArgs:
1717
if not isinstance(namespace, str):
1818
raise ValueError('namespace must be string')
19-
return {"namespace": namespace, **kwargs}
19+
base_args = {"namespace": namespace}
20+
return cast(DescribeNamespaceArgs, {**base_args, **kwargs})
2021

2122
@staticmethod
2223
def delete_namespace_args(namespace: str, **kwargs) -> DeleteNamespaceArgs:
2324
if not isinstance(namespace, str):
2425
raise ValueError('namespace must be string')
25-
return {"namespace": namespace, **kwargs}
26+
base_args = {"namespace": namespace}
27+
return cast(DeleteNamespaceArgs, {**base_args, **kwargs})
2628

2729
@staticmethod
2830
def list_namespaces_args(

0 commit comments

Comments
 (0)