ViderStar opened a new pull request, #75620:
URL: https://github.com/apache/airflow/pull/75620

   `PineconeHook.configure_index` defaults `pod_type` to `""`. With the 
pinecone 7 client this was harmless because the request factory skipped falsy 
values. The pinecone>=9 client (9.1.0 is the locked version) forwards every 
non-`None` value, so a call that only changes the replica count:
   
   ```python
   PineconeHook().configure_index("my-index", replicas=2)
   ```
   
   sends `{"spec": {"pod": {"replicas": 2, "pod_type": ""}}}` (9.1.0) or 
`{"deployment": {"replicas": 2, "pod_type": ""}}` (10.x) to the API, asking it 
to set an empty pod type instead of leaving the current one unchanged.
   
   This PR changes the default to `None` and maps an explicit `""` to `None` 
before calling the client. With the fix the request body is `{"spec": {"pod": 
{"replicas": 2}}}`.
   
   Tests: the old `test_configure_index` patched `configure_index` itself, so 
it never ran the hook code. I replaced it with a parametrized test that mocks 
`pinecone_client` and checks what is passed to `configure_index`. Two of its 
cases fail without the fix. `uv run --project providers/pinecone pytest 
providers/pinecone/tests/unit`: 22 passed. I checked the request body by 
patching the HTTP client of a real `pinecone==9.1.0` / `10.2.0` `Pinecone` 
object. I have no Pinecone pod index, so this was not run against the live API.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes (please specify the tool below)
   
   Generated-by: Claude Code following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   
   ---
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to