Skip to content

Commit e387f9e

Browse files
committed
Pass x-environment header
1 parent b77ecd1 commit e387f9e

File tree

17 files changed

+66
-18
lines changed

17 files changed

+66
-18
lines changed

.github/actions/cleanup-all/action.yml

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ inputs:
99
description: 'Delete all indexes and collections'
1010
required: false
1111
default: 'false'
12+
PINECONE_ADDITIONAL_HEADERS:
13+
description: 'Additional headers to send with the request'
14+
required: false
15+
default: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
1216

1317
runs:
1418
using: 'composite'
@@ -25,3 +29,4 @@ runs:
2529
env:
2630
PINECONE_API_KEY: ${{ inputs.PINECONE_API_KEY }}
2731
DELETE_ALL: ${{ inputs.DELETE_ALL }}
32+
PINECONE_ADDITIONAL_HEADERS: ${{ inputs.PINECONE_ADDITIONAL_HEADERS }}

.github/actions/create-index-legacy/action.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ inputs:
2323
PINECONE_API_KEY:
2424
description: 'The Pinecone API key'
2525
required: true
26+
PINECONE_ADDITIONAL_HEADERS:
27+
description: 'Additional headers to send with the request'
28+
required: false
29+
default: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
2630

2731
runs:
2832
using: 'composite'
@@ -36,14 +40,15 @@ runs:
3640
shell: bash
3741
run: |
3842
pip install pinecone-client==${{ inputs.pinecone_client_version }}
39-
43+
4044
- name: Create index
4145
id: create-index
4246
shell: bash
4347
run: ./python3 scripts/create-index-legacy.py
4448
env:
4549
PINECONE_API_KEY: ${{ inputs.PINECONE_API_KEY }}
4650
PINECONE_ENVIRONMENT: ${{ inputs.PINECONE_ENVIRONMENT }}
51+
PINECONE_ADDITIONAL_HEADERS: ${{ inputs.PINECONE_ADDITIONAL_HEADERS }}
4752
INDEX_NAME: ${{ inputs.index_name }}
4853
DIMENSION: ${{ inputs.dimension }}
4954
METRIC: ${{ inputs.metric }

.github/actions/create-index/action.yml

+6
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ inputs:
2525
PINECONE_API_KEY:
2626
description: 'The Pinecone API key'
2727
required: true
28+
PINECONE_ADDITIONAL_HEADERS:
29+
description: 'Additional headers to send with the request'
30+
required: false
31+
default: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
32+
2833

2934
outputs:
3035
index_name:
@@ -48,6 +53,7 @@ runs:
4853
run: poetry run python3 scripts/create.py
4954
env:
5055
PINECONE_API_KEY: ${{ inputs.PINECONE_API_KEY }}
56+
PINECONE_ADDITIONAL_HEADERS: ${{ inputs.PINECONE_ADDITIONAL_HEADERS }}
5157
NAME_PREFIX: ${{ inputs.name_prefix }}
5258
REGION: ${{ inputs.region }}
5359
CLOUD: ${{ inputs.cloud }}

.github/actions/delete-index/action.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ inputs:
88
PINECONE_API_KEY:
99
description: 'The Pinecone API key'
1010
required: true
11+
PINECONE_ADDITIONAL_HEADERS:
12+
description: 'Additional headers to send with the request'
13+
required: false
14+
default: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
1115

1216

1317
runs:
@@ -26,4 +30,5 @@ runs:
2630
run: poetry run python3 scripts/delete.py
2731
env:
2832
PINECONE_API_KEY: ${{ inputs.PINECONE_API_KEY }}
29-
INDEX_NAME: ${{ inputs.index_name }}
33+
PINECONE_ADDITIONAL_HEADERS: ${{ inputs.PINECONE_ADDITIONAL_HEADERS }}
34+
INDEX_NAME: ${{ inputs.index_name }}

.github/actions/test-data-asyncio/action.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ inputs:
1515
PINECONE_API_KEY:
1616
description: 'The Pinecone API key'
1717
required: true
18+
PINECONE_ADDITIONAL_HEADERS:
19+
description: 'Additional headers to send with the request'
20+
required: false
21+
default: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
1822
python_version:
1923
description: 'The version of Python to use'
2024
required: false
@@ -41,6 +45,7 @@ runs:
4145
run: poetry run pytest tests/integration/data_asyncio --retries 5 --retry-delay 35 -s -vv --log-cli-level=DEBUG
4246
env:
4347
PINECONE_API_KEY: ${{ inputs.PINECONE_API_KEY }}
48+
PINECONE_ADDITIONAL_HEADERS: ${{ inputs.PINECONE_ADDITIONAL_HEADERS }}
4449
USE_GRPC: ${{ inputs.use_grpc }}
4550
SPEC: ${{ inputs.spec }}
4651
FRESHNESS_TIMEOUT_SECONDS: ${{ inputs.freshness_timeout_seconds }}

.github/actions/test-data-plane/action.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ inputs:
1818
PINECONE_API_KEY:
1919
description: 'The Pinecone API key'
2020
required: true
21+
PINECONE_ADDITIONAL_HEADERS:
22+
description: 'Additional headers to send with the request'
23+
required: false
24+
default: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
2125
python_version:
2226
description: 'The version of Python to use'
2327
required: false
@@ -55,6 +59,7 @@ runs:
5559
run: poetry run pytest tests/integration/data --retries 5 --retry-delay 35 -s -vv --log-cli-level=DEBUG
5660
env:
5761
PINECONE_API_KEY: ${{ inputs.PINECONE_API_KEY }}
62+
PINECONE_ADDITIONAL_HEADERS: ${{ inputs.PINECONE_ADDITIONAL_HEADERS }}
5863
USE_GRPC: ${{ inputs.use_grpc }}
5964
METRIC: ${{ inputs.metric }}
6065
SPEC: ${{ inputs.spec }}

.github/actions/test-dependency-asyncio-rest/action.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ inputs:
55
PINECONE_API_KEY:
66
description: 'The Pinecone API key'
77
required: true
8+
PINECONE_ADDITIONAL_HEADERS:
9+
description: 'Additional headers to send with the request'
10+
required: false
11+
default: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
812
index_name:
913
description: 'The name of the index'
1014
required: true
@@ -43,4 +47,5 @@ runs:
4347
command: poetry run pytest tests/dependency/asyncio-rest -s -v
4448
env:
4549
PINECONE_API_KEY: '${{ inputs.PINECONE_API_KEY }}'
50+
PINECONE_ADDITIONAL_HEADERS: '${{ inputs.PINECONE_ADDITIONAL_HEADERS }}'
4651
INDEX_NAME: '${{ inputs.index_name }}'

.github/actions/test-dependency-grpc/action.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ inputs:
55
PINECONE_API_KEY:
66
description: 'The Pinecone API key'
77
required: true
8+
PINECONE_ADDITIONAL_HEADERS:
9+
description: 'Additional headers to send with the request'
10+
required: false
11+
default: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
812
index_name:
913
description: 'The name of the index'
1014
required: true
@@ -63,4 +67,5 @@ runs:
6367
command: poetry run pytest tests/dependency/grpc -s -v
6468
env:
6569
PINECONE_API_KEY: ${{ inputs.PINECONE_API_KEY }}
70+
PINECONE_ADDITIONAL_HEADERS: ${{ inputs.PINECONE_ADDITIONAL_HEADERS }}
6671
INDEX_NAME: ${{ inputs.index_name }}

.github/actions/test-dependency-rest/action.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ inputs:
55
PINECONE_API_KEY:
66
description: 'The Pinecone API key'
77
required: true
8+
PINECONE_ADDITIONAL_HEADERS:
9+
description: 'Additional headers to send with the request'
10+
required: false
11+
default: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
812
index_name:
913
description: 'The name of the index'
1014
required: true
@@ -42,4 +46,5 @@ runs:
4246
command: poetry run pytest tests/dependency/rest -s -v
4347
env:
4448
PINECONE_API_KEY: '${{ inputs.PINECONE_API_KEY }}'
49+
PINECONE_ADDITIONAL_HEADERS: '${{ inputs.PINECONE_ADDITIONAL_HEADERS }}'
4550
INDEX_NAME: '${{ inputs.index_name }}'

.github/workflows/testing-dependency-asyncio.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ jobs:
2727
python_version: '${{ matrix.python_version }}'
2828
index_name: '${{ inputs.index_name }}'
2929
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
30+
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
3031
aiohttp_version: '${{ matrix.aiohttp_version }}'

.github/workflows/testing-dependency-grpc.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ jobs:
5353
python_version: '${{ matrix.python_version }}'
5454
index_name: '${{ inputs.index_name }}'
5555
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
56+
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
5657
grpcio_version: '${{ matrix.grpcio_version }}'
5758
lz4_version: '${{ matrix.lz4_version }}'
5859
protobuf_version: '${{ matrix.protobuf_version }}'
@@ -86,6 +87,7 @@ jobs:
8687
python_version: '${{ matrix.python_version }}'
8788
index_name: '${{ inputs.index_name }}'
8889
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
90+
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
8991
grpcio_version: '${{ matrix.grpcio_version }}'
9092
lz4_version: '${{ matrix.lz4_version }}'
9193
protobuf_version: '${{ matrix.protobuf_version }}'
@@ -118,6 +120,7 @@ jobs:
118120
python_version: '${{ matrix.python_version }}'
119121
index_name: '${{ inputs.index_name }}'
120122
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
123+
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
121124
grpcio_version: '${{ matrix.grpcio_version }}'
122125
lz4_version: '${{ matrix.lz4_version }}'
123126
protobuf_version: '${{ matrix.protobuf_version }}'

.github/workflows/testing-dependency-rest.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
python_version: '${{ matrix.python_version }}'
3131
index_name: '${{ inputs.index_name }}'
3232
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
33+
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
3334
urllib3_version: '${{ matrix.urllib3_version }}'
3435

3536

@@ -53,6 +54,7 @@ jobs:
5354
python_version: '${{ matrix.python_version }}'
5455
index_name: '${{ inputs.index_name }}'
5556
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
57+
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
5658
urllib3_version: '${{ matrix.urllib3_version }}'
5759

5860
dependency-matrix-rest-313:
@@ -75,4 +77,5 @@ jobs:
7577
python_version: '${{ matrix.python_version }}'
7678
index_name: '${{ inputs.index_name }}'
7779
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
80+
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
7881
urllib3_version: '${{ matrix.urllib3_version }}'

.github/workflows/testing-dependency.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
name_prefix: depstest-${{ github.run_number }}
2020
dimension: 2
2121
PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}
22+
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
2223

2324
dependency-test-rest:
2425
uses: './.github/workflows/testing-dependency-rest.yaml'
@@ -55,3 +56,4 @@ jobs:
5556
with:
5657
index_name: '${{ needs.deps-test-setup.outputs.index_name }}'
5758
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
59+
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'

.github/workflows/testing-integration-asyncio.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
run: poetry run pytest tests/integration/data_asyncio --retries 5 --retry-delay 35 -s -vv --log-cli-level=DEBUG
3030
env:
3131
PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}
32+
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
3233

3334
db-control-asyncio:
3435
name: db_control asyncio
@@ -54,3 +55,4 @@ jobs:
5455
run: poetry run pytest tests/integration/control_asyncio/*.py --retries 5 --retry-delay 35 -s -vv --log-cli-level=DEBUG
5556
env:
5657
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
58+
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'

.github/workflows/testing-integration.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ jobs:
77
name: Reorg tests
88
runs-on: ubuntu-latest
99
env:
10-
PINECONE_DEBUG_CURL: 'false'
1110
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
12-
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client"}'
11+
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
1312
strategy:
1413
fail-fast: false
1514
matrix:
@@ -54,8 +53,8 @@ jobs:
5453
- name: 'Run integration tests'
5554
run: poetry run pytest tests/integration/inference --retries 5 --retry-delay 35 -s -vv --log-cli-level=DEBUG
5655
env:
57-
PINECONE_DEBUG_CURL: 'true'
5856
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
57+
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
5958

6059

6160
dependency-test-asyncio:
@@ -84,6 +83,7 @@ jobs:
8483
metric: 'cosine'
8584
spec: '{ "serverless": { "region": "us-west-2", "cloud": "aws" }}'
8685
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
86+
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
8787
freshness_timeout_seconds: 600
8888
skip_weird_id_tests: 'true'
8989

@@ -146,7 +146,7 @@ jobs:
146146
- name: 'Run integration tests (REST)'
147147
run: poetry run pytest tests/integration/control/serverless --retries 5 --retry-delay 35 -s -vv --log-cli-level=DEBUG
148148
env:
149-
PINECONE_DEBUG_CURL: 'true'
150149
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
150+
PINECONE_ADDITIONAL_HEADERS: '{"sdk-test-suite": "pinecone-python-client", "x-environment": "preprod-aws-0"}'
151151
SERVERLESS_CLOUD: '${{ matrix.testConfig.serverless.cloud }}'
152152
SERVERLESS_REGION: '${{ matrix.testConfig.serverless.region }}'

tests/integration/control/pod/conftest.py

+2-8
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77

88
@pytest.fixture()
99
def client():
10-
api_key = get_environment_var("PINECONE_API_KEY")
11-
return Pinecone(
12-
api_key=api_key, additional_headers={"sdk-test-suite": "pinecone-python-client"}
13-
)
10+
return Pinecone()
1411

1512

1613
@pytest.fixture()
@@ -66,10 +63,7 @@ def notready_index(client, index_name, create_index_params):
6663

6764
@pytest.fixture(scope="session")
6865
def reusable_collection():
69-
pc = Pinecone(
70-
api_key=get_environment_var("PINECONE_API_KEY"),
71-
additional_headers={"sdk-test-suite": "pinecone-python-client"},
72-
)
66+
pc = Pinecone()
7367
index_name = generate_index_name("temp-index")
7468
dimension = int(get_environment_var("DIMENSION"))
7569
print(f"Creating index {index_name} to prepare a collection...")

tests/integration/control/serverless/conftest.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@
1111

1212
@pytest.fixture()
1313
def client():
14-
api_key = get_environment_var("PINECONE_API_KEY")
15-
return Pinecone(
16-
api_key=api_key, additional_headers={"sdk-test-suite": "pinecone-python-client"}
17-
)
14+
return Pinecone()
1815

1916

2017
@pytest.fixture()

0 commit comments

Comments
 (0)