Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/test-data-asyncio/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ runs:
- name: Run data plane tests
id: data-plane-asyncio-tests
shell: bash
run: poetry run pytest tests/integration/data_asyncio -s -vv
run: poetry run pytest tests/integration/data_asyncio --retries 5 --retry-delay 35 -s -vv --log-cli-level=DEBUG
env:
PINECONE_API_KEY: ${{ inputs.PINECONE_API_KEY }}
USE_GRPC: ${{ inputs.use_grpc }}
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/test-data-plane/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ runs:
- name: Run data plane tests
id: data-plane-tests
shell: bash
run: poetry run pytest tests/integration/data
run: poetry run pytest tests/integration/data --retries 5 --retry-delay 35 -s -vv --log-cli-level=DEBUG
env:
PINECONE_API_KEY: ${{ inputs.PINECONE_API_KEY }}
USE_GRPC: ${{ inputs.use_grpc }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/testing-integration-asyncio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Run data plane tests
id: data-plane-asyncio-tests
shell: bash
run: poetry run pytest tests/integration/data_asyncio -s -vv
run: poetry run pytest tests/integration/data_asyncio --retries 5 --retry-delay 35 -s -vv --log-cli-level=DEBUG
env:
PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}

Expand All @@ -51,6 +51,6 @@ jobs:
include_asyncio: true
include_dev: true
- name: 'db_control asyncio'
run: poetry run pytest tests/integration/control_asyncio -s -vv
run: poetry run pytest tests/integration/control_asyncio --retries 5 --retry-delay 35 -s -vv --log-cli-level=DEBUG
env:
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
4 changes: 2 additions & 2 deletions .github/workflows/testing-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
with:
include_asyncio: true
- name: 'Run integration tests'
run: poetry run pytest tests/integration/inference -s -vv
run: poetry run pytest tests/integration/inference --retries 5 --retry-delay 35 -s -vv --log-cli-level=DEBUG
env:
PINECONE_DEBUG_CURL: 'true'
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
- name: Setup Poetry
uses: ./.github/actions/setup-poetry
- name: 'Run integration tests (REST)'
run: poetry run pytest tests/integration/control/serverless -s -vv
run: poetry run pytest tests/integration/control/serverless --retries 5 --retry-delay 35 -s -vv --log-cli-level=DEBUG
env:
PINECONE_DEBUG_CURL: 'true'
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/testing-unit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
include_asyncio: true

- name: Run unit tests (REST)
run: poetry run pytest --cov=pinecone --timeout=120 tests/unit
run: poetry run pytest --cov=pinecone --timeout=120 tests/unit --retries 5 --retry-delay 35 -s -vv --log-cli-level=DEBUG
- name: Run unit tests (GRPC)
if: ${{ matrix.use_grpc == true }}
run: poetry run pytest --cov=pinecone/grpc --timeout=120 tests/unit_grpc
run: poetry run pytest --cov=pinecone/grpc --timeout=120 tests/unit_grpc --retries 5 --retry-delay 35 -s -vv --log-cli-level=DEBUG
4 changes: 2 additions & 2 deletions pinecone/grpc/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ def parse_fetch_response(response: Message):
for id, vec in vectors.items():
vd[id] = _Vector(
id=vec["id"],
values=vec["values"],
sparse_values=parse_sparse_values(vec.get("sparseValues")),
values=vec.get("values", None),
sparse_values=parse_sparse_values(vec.get("sparseValues", None)),
metadata=vec.get("metadata", None),
_check_type=False,
)
Expand Down
10 changes: 8 additions & 2 deletions pinecone/utils/tqdm.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import warnings

__all__ = ["tqdm"]

try:
# Use the notebook-friendly auto selection if tqdm is installed.
from tqdm.auto import tqdm
# Suppress the specific tqdm warning about IProgress
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=UserWarning, module="tqdm")
from tqdm.auto import tqdm
except ImportError:
# Fallback: define a dummy tqdm that supports the same interface.
class tqdm: # type: ignore
Expand Down
19 changes: 18 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ pytest = "8.2.0"
pytest-asyncio = "^0.25.2"
pytest-cov = "2.10.1"
pytest-mock = "3.6.1"
pytest-retry = "^1.7.0"
pytest-timeout = "2.2.0"
pytest-benchmark = [
{ version = '5.0.0', python = ">=3.9,<4.0" }
Expand Down
7 changes: 4 additions & 3 deletions tests/integration/data/test_fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ def test_fetch_unspecified_namespace(self, idx):
assert results.vectors["1"].values is not None
assert results.vectors["4"].metadata is not None

@pytest.mark.skip(reason="Backend implementation not ready")
def test_fetch_sparse_index(self, sparse_idx):
sparse_idx.upsert(
vectors=[
Expand All @@ -165,9 +164,11 @@ def test_fetch_sparse_index(self, sparse_idx):
assert fetch_results.namespace == ""
assert len(fetch_results.vectors) == 10
for i in range(10):
logger.debug(fetch_results.vectors[str(i)])
assert fetch_results.vectors[str(i)].id == str(i)
assert fetch_results.vectors[str(i)].values is not None
assert len(fetch_results.vectors[str(i)].values) == 2
assert fetch_results.vectors[str(i)].sparse_values is not None
assert len(fetch_results.vectors[str(i)].sparse_values.indices) == 2
assert len(fetch_results.vectors[str(i)].sparse_values.values) == 2
assert fetch_results.vectors[str(i)].metadata is not None
assert fetch_results.vectors[str(i)].metadata["genre"] == "action"
assert fetch_results.vectors[str(i)].metadata["runtime"] == 120
1 change: 1 addition & 0 deletions tests/integration/data/test_list_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def seed_for_list2(idx, list_errors_namespace, wait=True):

@pytest.mark.usefixtures("seed_for_list2")
class TestListErrors:
@pytest.mark.skip(reason="Bug filed https://github.com/pinecone-io/pinecone-db/issues/9578")
def test_list_change_prefix_while_fetching_next_page(self, idx, list_errors_namespace):
results = idx.list_paginated(prefix="99", limit=5, namespace=list_errors_namespace)
with pytest.raises(PineconeException) as e:
Expand Down
12 changes: 10 additions & 2 deletions tests/integration/data/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@ def test_query_by_vector_include_metadata(self, idx, query_namespace, use_nondef
assert isinstance(results, QueryResponse) == True
assert results.namespace == target_namespace

matches_with_metadata = [match for match in results.matches if match.metadata is not None]
matches_with_metadata = [
match
for match in results.matches
if match.metadata is not None and match.metadata != {}
]
assert len(matches_with_metadata) == 3
assert find_by_id(results.matches, "4").metadata["genre"] == "action"

Expand All @@ -134,7 +138,11 @@ def test_query_by_vector_include_values_and_metadata(
assert isinstance(results, QueryResponse) == True
assert results.namespace == target_namespace

matches_with_metadata = [match for match in results.matches if match.metadata is not None]
matches_with_metadata = [
match
for match in results.matches
if match.metadata is not None and match.metadata != {}
]
assert len(matches_with_metadata) == 3
assert find_by_id(results.matches, "4").metadata["genre"] == "action"
assert len(results.matches[0].values) == self.expected_dimension
Expand Down