Skip to content

Commit

Permalink
Add on_error
Browse files Browse the repository at this point in the history
  • Loading branch information
jhamon committed Aug 29, 2024
1 parent 85897bf commit c784fe8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 2 additions & 1 deletion pinecone/data/features/bulk_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def __init__(self, **kwargs):
)

@prerelease_feature
def start_import(self, uri: str, integration: Optional[str] = None) -> StartImportResponse:
def start_import(self, uri: str, integration: Optional[str] = None, on_error=Optional[str]) -> StartImportResponse:
"""Import data from a URI into an index.
Examples:
Expand All @@ -69,6 +69,7 @@ def start_import(self, uri: str, integration: Optional[str] = None) -> StartImpo
[
("uri", uri),
("integration", integration),
("on_error", on_error),
]
)
return self.__import_operations_api.start_import(StartImportRequest(**args_dict))
Expand Down
6 changes: 2 additions & 4 deletions tests/unit/data/test_bulk_import.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import pytest
import warnings

from urllib3 import BaseHTTPResponse, HTTPResponse

from datetime import datetime, date
from urllib3 import BaseHTTPResponse

from pinecone.core_ea.openapi.db_data.api.bulk_operations_api import BulkOperationsApi
from pinecone.core_ea.openapi.db_data.models import ImportModel, StartImportResponse
Expand Down Expand Up @@ -83,6 +81,6 @@ def test_no_arguments(self, mocker):

with pytest.warns(UserWarning, match="prerelease"):
with pytest.raises(TypeError) as e:
my_import = client.start_import()
client.start_import()

assert "missing 1 required positional argument" in str(e.value)

0 comments on commit c784fe8

Please sign in to comment.