Skip to content

Commit 403ca2d

Browse files
committed
update return type
1 parent ea20fa9 commit 403ca2d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

pinecone/repository_control/request_factory.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,22 +55,21 @@ def __parse_repository_spec(spec: Union[Dict, ServerlessSpec]) -> OpenAPIReposit
5555
return repository_spec
5656

5757
@staticmethod
58-
def __parse_repository_schema(schema: Union[Dict, DocumentSchema]) -> DocumentSchema:
58+
def __parse_repository_schema(schema: Union[Dict, DocumentSchema]) -> OpenAPIDocumentSchema:
5959
if isinstance(schema, dict):
6060
if "fields" in schema:
6161
openapi_schema = OpenAPIDocumentSchema(
6262
fields=OpenAPIDocumentSchemaFieldMap(**schema["fields"])
6363
)
64-
repository_schema = DocumentSchema(openapi_schema)
64+
return openapi_schema
6565
else:
6666
raise ValueError("schema must contain a 'fields' key")
6767
elif isinstance(schema, DocumentSchema):
68-
repository_schema = schema
68+
# Extract the OpenAPI schema from the wrapper
69+
return schema.schema
6970
else:
7071
raise TypeError("schema must be of type dict or DocumentSchema")
7172

72-
return repository_schema
73-
7473
@staticmethod
7574
def create_repository_request(
7675
name: str, spec: Union[Dict, ServerlessSpec], schema: Union[Dict, DocumentSchema]

0 commit comments

Comments
 (0)