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

Update objects.rb to pass tenant to batch_delete as param #45

Merged
merged 2 commits into from
Feb 3, 2024

Conversation

mepatterson
Copy link
Contributor

Turns out, with multi-tenancy, batch_delete also needs to pass along the tenant as a request param. This patch works for me, but I'm not sure how this will affect the final query if consistency_level is being used. Thoughts?

@andreibondarev
Copy link
Collaborator

@mepatterson I'm not too sure. Sounds like a question to pose to the Weaviate folks themselves.

@mepatterson
Copy link
Contributor Author

I actually meant in terms of how your code is inlining the consistency into the request path...

      unless consistency_level.nil?
        validate_consistency_level!(consistency_level)

        path << "?consistency_level=#{consistency_level.to_s.upcase}"
      end

Will adding a req.params cause any issue with constructing the full request? If not, then I think my fix is fine.

@andreibondarev
Copy link
Collaborator

andreibondarev commented Feb 3, 2024

I actually meant in terms of how your code is inlining the consistency into the request path...

      unless consistency_level.nil?
        validate_consistency_level!(consistency_level)

        path << "?consistency_level=#{consistency_level.to_s.upcase}"
      end

Will adding a req.params cause any issue with constructing the full request? If not, then I think my fix is fine.

Ohh! Good question, I'm not sure. Do you think you could refactor the consistency_level param to be passed in to the req.params as well just to be safe? Something like this should do it:

validate_consistency_level!(consistency_level) unless consistency_level.nil?
req.params["consistency_level"] = consistency_level.to_s.upcase unless unless consistency_level.nil?

@mepatterson
Copy link
Contributor Author

Updated

@andreibondarev andreibondarev merged commit c8ad2af into patterns-ai-core:main Feb 3, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants