Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Astra DB] Explicit projection when reading from Astra DB #733

Merged
merged 1 commit into from
May 15, 2024

Conversation

hemidactylus
Copy link
Contributor

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.

@hemidactylus hemidactylus requested a review from a team as a code owner May 14, 2024 09:37
@hemidactylus hemidactylus requested review from julian-risch and removed request for a team May 14, 2024 09:37
@CLAassistant
Copy link

CLAassistant commented May 14, 2024

CLA assistant check
All committers have signed the CLA.

@hemidactylus
Copy link
Contributor Author

@erichare FYI

@julian-risch
Copy link
Member

Hello @hemidactylus and thank you for opening this pull request! 🙂Could you please share some more context regarding upcoming changes in the Astra DB Data API? Any links to documentation or release notes? And could you share how you tested the changes? Thank you!

Copy link
Contributor

@masci masci left a comment

Choose a reason for hiding this comment

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

Thank you! Merging and drafting a new release

@masci masci merged commit c4f1cc4 into deepset-ai:main May 15, 2024
10 checks passed
@hemidactylus
Copy link
Contributor Author

Hello, @julian-risch ! At this stage, the plans to drop the $vector field from the default projection are just plans with no defined timeline. The reasoning is that returning that field often bloats the response for no reason, as most applications do not actually need the very vector back when doing reads.
And since it's a good practice to specify a projection explicitly, this was a good enough reason in my view to do so in this code, making the read path resilient against changes in the API.
(reference: this docs page implies that "special" fields are not guaranteed to be included in the default projection).

As for testing ... I have to admit that given the simplicity of the change I just ran the relevant parts of the new code manually on a handmade collection, to make sure there were no trivial issues, and that was it.

Also @masci grazie per il merge ;)

@julian-risch
Copy link
Member

Thank you @hemidactylus and @masci !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants