Skip to content
2 changes: 1 addition & 1 deletion .github/actions/project-create/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ runs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: '3.10'

- name: Install deps
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/project-delete/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ runs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: '3.10'

- name: Install deps
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/run-integration-test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ runs:
- name: Run tests
id: run-tests
shell: bash
run: poetry run pytest tests/integration/${{ inputs.test_suite }} --retries 2 --retry-delay 35 -s -vv --log-cli-level=DEBUG
run: poetry run pytest tests/integration/${{ inputs.test_suite }} --retries 2 --retry-delay 35 -s -vv --log-cli-level=DEBUG --durations=20
env:
PINECONE_API_KEY: ${{ steps.decrypt-api-key.outputs.decrypted_secret }}
PINECONE_ADDITIONAL_HEADERS: ${{ inputs.PINECONE_ADDITIONAL_HEADERS }}
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup-poetry/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ inputs:
python_version:
description: 'Python version to use'
required: true
default: '3.9'
default: '3.10'

runs:
using: 'composite'
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/test-dependency-asyncio-rest/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ inputs:
python_version:
description: 'The version of Python to use'
required: false
default: '3.9'
default: '3.10'
aiohttp_version:
description: 'The version of aiohttp to install'
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/test-dependency-grpc/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ inputs:
python_version:
description: 'The version of Python to use'
required: false
default: '3.9'
default: '3.10'
grpcio_version:
description: 'The version of grpcio to install'
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/test-dependency-rest/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ inputs:
python_version:
description: 'The version of Python to use'
required: false
default: '3.9'
default: '3.10'
urllib3_version:
description: 'The version of urllib3 to install'
required: true
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/on-merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
uses: './.github/workflows/testing-unit.yaml'
secrets: inherit
with:
python_versions_json: '["3.9", "3.13"]'
python_versions_json: '["3.10", "3.13"]'

create-project:
uses: './.github/workflows/project-setup.yaml'
Expand All @@ -51,7 +51,7 @@ jobs:
- create-project
with:
encrypted_project_api_key: ${{ needs.create-project.outputs.encrypted_project_api_key }}
python_versions_json: '["3.9", "3.13"]'
python_versions_json: '["3.10", "3.13"]'
dependency-tests:
uses: './.github/workflows/testing-dependency.yaml'
secrets: inherit
Expand Down Expand Up @@ -85,7 +85,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9, 3.13]
python-version: ['3.10', '3.13']
steps:
- uses: actions/checkout@v4
- name: Setup Poetry
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/on-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
uses: './.github/workflows/testing-unit.yaml'
secrets: inherit
with:
python_versions_json: '["3.9"]'
python_versions_json: '["3.10"]'

determine-test-suites:
name: Determine test suites
Expand Down Expand Up @@ -112,7 +112,7 @@ jobs:
- determine-test-suites
with:
encrypted_project_api_key: ${{ needs.create-project.outputs.encrypted_project_api_key }}
python_versions_json: '["3.13", "3.9"]'
python_versions_json: '["3.10"]'
rest_sync_suites_json: ${{ needs.determine-test-suites.outputs.rest_sync_suites || '' }}
rest_asyncio_suites_json: ${{ needs.determine-test-suites.outputs.rest_asyncio_suites || '' }}
grpc_sync_suites_json: ${{ needs.determine-test-suites.outputs.grpc_sync_suites || '' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/project-cleanup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-poetry
with:
python_version: 3.9
python_version: '3.10'
- uses: ./.github/actions/project-delete
with:
FERNET_ENCRYPTION_KEY: '${{ secrets.FERNET_ENCRYPTION_KEY }}'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/project-setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-poetry
with:
python_version: 3.9
python_version: '3.10'
- uses: ./.github/actions/project-create
id: create-project-step
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
uses: './.github/workflows/testing-unit.yaml'
secrets: inherit
with:
python_versions_json: '["3.9"]'
python_versions_json: '["3.10"]'

create-project:
uses: './.github/workflows/project-setup.yaml'
Expand All @@ -42,7 +42,7 @@ jobs:
- create-project
with:
encrypted_project_api_key: ${{ needs.create-project.outputs.encrypted_project_api_key }}
python_versions_json: '["3.9", "3.13"]'
python_versions_json: '["3.10", "3.13"]'

dependency-tests:
uses: './.github/workflows/testing-dependency.yaml'
Expand Down Expand Up @@ -91,4 +91,4 @@ jobs:
secrets: inherit
with:
project_id: ${{ needs.create-project.outputs.project_id }}
encrypted_project_api_key: ${{ needs.create-project.outputs.encrypted_project_api_key }}
encrypted_project_api_key: ${{ needs.create-project.outputs.encrypted_project_api_key }}
4 changes: 2 additions & 2 deletions .github/workflows/testing-dependency-asyncio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
fail-fast: false
matrix:
python_version:
- 3.9
- '3.10'
- 3.13
aiohttp_version:
- 3.9.0
- 3.10.0
- 3.11.5
steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/testing-dependency-grpc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ on:

jobs:
dependency-matrix-grpc:
name: GRPC py3.9/py3.10
name: GRPC py3.10/py3.10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

both versions are 3.10?

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python_version:
- 3.9
- '3.10'
- "3.10"
grpcio_version:
- 1.44.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testing-dependency-rest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
fail-fast: false
matrix:
python_version:
- 3.9
- '3.10'
- 3.11
urllib3_version:
- 1.26.0
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/testing-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest, macos-latest]
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
python: ['3.10', '3.11', '3.12', '3.13']


steps:
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
fail-fast: true
matrix:
os: [windows-latest]
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
python: ['3.10', '3.11', '3.12', '3.13']
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/testing-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ jobs:
if: ${{ inputs.rest_sync_suites_json == '' || (inputs.rest_sync_suites_json != '' && fromJson(inputs.rest_sync_suites_json)[0] != null) }}
strategy:
fail-fast: false
max-parallel: 4
matrix:
python_version: ${{ fromJson(inputs.python_versions_json) }}
test_suite: ${{ inputs.rest_sync_suites_json != '' && fromJson(inputs.rest_sync_suites_json) || fromJson('["control/serverless", "control/resources/index", "control/resources/collections", "inference/sync", "plugins", "data"]') }}
Expand All @@ -59,7 +58,6 @@ jobs:
if: ${{ inputs.rest_asyncio_suites_json == '' || (inputs.rest_asyncio_suites_json != '' && fromJson(inputs.rest_asyncio_suites_json)[0] != null) }}
strategy:
fail-fast: false
max-parallel: 4
matrix:
python_version: ${{ fromJson(inputs.python_versions_json) }}
test_suite: ${{ inputs.rest_asyncio_suites_json != '' && fromJson(inputs.rest_asyncio_suites_json) || fromJson('["control_asyncio/resources/index", "control_asyncio/*.py", "inference/asyncio", "data_asyncio"]') }}
Expand Down
5 changes: 3 additions & 2 deletions pinecone/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@
"ScoredVector": ("pinecone.db_data.models", "ScoredVector"),
"SingleQueryResults": ("pinecone.db_data.models", "SingleQueryResults"),
"QueryRequest": ("pinecone.db_data.models", "QueryRequest"),
"QueryResponse": ("pinecone.db_data.models", "QueryResponse"),
"UpsertResponse": ("pinecone.db_data.models", "UpsertResponse"),
"QueryResponse": ("pinecone.db_data.dataclasses", "QueryResponse"),
"UpsertResponse": ("pinecone.db_data.dataclasses", "UpsertResponse"),
"UpdateResponse": ("pinecone.db_data.dataclasses", "UpdateResponse"),
"UpdateRequest": ("pinecone.db_data.models", "UpdateRequest"),
"NamespaceDescription": ("pinecone.core.openapi.db_data.models", "NamespaceDescription"),
"ImportErrorMode": ("pinecone.db_data.resources.sync.bulk_import", "ImportErrorMode"),
Expand Down
17 changes: 11 additions & 6 deletions pinecone/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,20 @@ from pinecone.db_data.dataclasses import (
SearchQuery,
SearchQueryVector,
SearchRerank,
FetchResponse,
FetchByMetadataResponse,
QueryResponse,
UpsertResponse,
UpdateResponse,
)
from pinecone.db_data.models import (
FetchResponse,
DeleteRequest,
DescribeIndexStatsRequest,
IndexDescription as DescribeIndexStatsResponse,
RpcStatus,
ScoredVector,
SingleQueryResults,
QueryRequest,
QueryResponse,
UpsertResponse,
UpdateRequest,
)
from pinecone.core.openapi.db_data.models import NamespaceDescription
Expand Down Expand Up @@ -120,17 +122,20 @@ __all__ = [
"SearchQuery",
"SearchQueryVector",
"SearchRerank",
# Model classes
# Data response classes
"FetchResponse",
"FetchByMetadataResponse",
"QueryResponse",
"UpsertResponse",
"UpdateResponse",
# Model classes
"DeleteRequest",
"DescribeIndexStatsRequest",
"DescribeIndexStatsResponse",
"RpcStatus",
"ScoredVector",
"SingleQueryResults",
"QueryRequest",
"QueryResponse",
"UpsertResponse",
"UpdateRequest",
"NamespaceDescription",
"ImportErrorMode",
Expand Down
6 changes: 6 additions & 0 deletions pinecone/db_data/dataclasses/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
from .search_query import SearchQuery
from .search_query_vector import SearchQueryVector
from .search_rerank import SearchRerank
from .query_response import QueryResponse
from .upsert_response import UpsertResponse
from .update_response import UpdateResponse

__all__ = [
"SparseValues",
Expand All @@ -15,4 +18,7 @@
"SearchQuery",
"SearchQueryVector",
"SearchRerank",
"QueryResponse",
"UpsertResponse",
"UpdateResponse",
]
13 changes: 9 additions & 4 deletions pinecone/db_data/dataclasses/fetch_by_metadata_response.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
from dataclasses import dataclass
from typing import Dict, Optional
from dataclasses import dataclass, field
from typing import Dict, Optional, cast

from .vector import Vector
from .utils import DictLike
from pinecone.utils.response_info import ResponseInfo


@dataclass
class Pagination:
class Pagination(DictLike):
next: str


@dataclass
class FetchByMetadataResponse:
class FetchByMetadataResponse(DictLike):
namespace: str
vectors: Dict[str, Vector]
usage: Dict[str, int]
pagination: Optional[Pagination] = None
_response_info: ResponseInfo = field(
default_factory=lambda: cast(ResponseInfo, {"raw_headers": {}}), repr=True, compare=False
)
11 changes: 8 additions & 3 deletions pinecone/db_data/dataclasses/fetch_response.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
from dataclasses import dataclass
from typing import Dict
from dataclasses import dataclass, field
from typing import Dict, cast

from .vector import Vector
from .utils import DictLike
from pinecone.utils.response_info import ResponseInfo


@dataclass
class FetchResponse:
class FetchResponse(DictLike):
namespace: str
vectors: Dict[str, Vector]
usage: Dict[str, int]
_response_info: ResponseInfo = field(
default_factory=lambda: cast(ResponseInfo, {"raw_headers": {}}), repr=True, compare=False
)
25 changes: 25 additions & 0 deletions pinecone/db_data/dataclasses/query_response.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from dataclasses import dataclass, field
from typing import List, Optional, cast

from .utils import DictLike
from pinecone.utils.response_info import ResponseInfo
from pinecone.core.openapi.db_data.models import ScoredVector, Usage


@dataclass
class QueryResponse(DictLike):
"""Response from a query operation.

Attributes:
matches: List of matched vectors with scores.
namespace: The namespace that was queried.
usage: Usage information (optional).
_response_info: Response metadata including LSN headers.
"""

matches: List[ScoredVector]
namespace: str
usage: Optional[Usage] = None
_response_info: ResponseInfo = field(
default_factory=lambda: cast(ResponseInfo, {"raw_headers": {}}), repr=True, compare=False
)
3 changes: 2 additions & 1 deletion pinecone/db_data/dataclasses/search_query.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
from dataclasses import dataclass
from typing import Optional, Any, Dict, Union
from .search_query_vector import SearchQueryVector
from .utils import DictLike
from ..types.search_query_vector_typed_dict import SearchQueryVectorTypedDict


@dataclass
class SearchQuery:
class SearchQuery(DictLike):
"""
SearchQuery represents the query when searching within a specific namespace.
"""
Expand Down
3 changes: 2 additions & 1 deletion pinecone/db_data/dataclasses/search_query_vector.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from dataclasses import dataclass
from typing import Optional, List
from .utils import DictLike


@dataclass
class SearchQueryVector:
class SearchQueryVector(DictLike):
"""
SearchQueryVector represents the vector values used to query.
"""
Expand Down
Loading