semantic-kernel
semantic-kernel copied to clipboard
Python: (Astra DB) Explicit projection when reading from Astra DB
Motivation and Context
In view of upcoming changes in the Astra DB Data API, this PR explicitly sets a projection every time a find command is executed, in order to ensure all necessary fields of the document are returned by the API.
Description
Added an else branch in the astra_client.py to ensure there always is a "projection" field in the body for the find command. This ensures that $vector is returned by the API even in case of Astra DB rolling out an exclude-it-by-default policy in the future.
Contribution Checklist
- [x] The code builds clean without any errors or warnings
- [x] The PR follows the SK Contribution Guidelines and the pre-submission formatting script raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone :smile: