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

Collection name does not always auto capitalize the first letter #6549

Open
fellalli opened this issue Nov 19, 2024 · 4 comments · May be fixed by weaviate/weaviate-python-client#1471
Open
Assignees
Labels
bug DX Developer and Contributor Experience

Comments

@fellalli
Copy link

Weaviate auto capitalizes the first letter when creating a collection, as it follows the GraphQL naming conventions. However, it does not auto capitalize the first letter in some other situations.

Example

✔️ client.collections.create(name="test") -> creates collection Test
✔️ client.collections.delete("test") -> deletes collection Test
✔️ client.collections.get("test") -> gets collection Test
Filter.by_ref_multi_target("hasQuestion", target_collection="test") -> does not work because it looks for test and not Test

Expected behavior

I expect that the first letter is always auto capitalized when working with collections for consistency (and less debugging).


I used the weaviate-python-client for testing. If the auto capitalization is made in Weaviate, please transfer this issue accordingly.

@tsmith023 tsmith023 added the bug label Nov 19, 2024
@dirkkul dirkkul transferred this issue from weaviate/weaviate-python-client Dec 5, 2024
@dirkkul dirkkul added the DX Developer and Contributor Experience label Dec 5, 2024
@melsonic
Copy link
Contributor

melsonic commented Dec 8, 2024

@tsmith023 can I pick this up?

@tsmith023
Copy link
Contributor

@melsonic, please do! I'd be happy to review the PR if you @ me on it once ready 😁

@melsonic
Copy link
Contributor

melsonic commented Dec 9, 2024

@melsonic, please do! I'd be happy to review the PR if you @ me on it once ready 😁

Sure thing @tsmith023 🚀🚀🚀

Meanwhile, I have another open PR, could you please review that one if possible?
Here is the PR

@melsonic
Copy link
Contributor

Hi @tsmith023, I have gone through the codebase both (weaviate core & weaviate-python-client). Based on that I believe the auto-capitalize functionality is implemented in weaviate-python-client. As for all the 3 methods mentioned, I could see the function _capitalize_first_letter is used to capitalize the first letter of the collection.

Method LN
client.collections.get() https://github.com/weaviate/weaviate-python-client/blob/b56fc00d5b223a879e5f932213ea3c4fa398432e/weaviate/collections/collections/async_.py#L179
client.collections.delete() https://github.com/weaviate/weaviate-python-client/blob/b56fc00d5b223a879e5f932213ea3c4fa398432e/weaviate/collections/collections/async_.py#L209
client.collections.create() https://github.com/weaviate/weaviate-python-client/blob/b56fc00d5b223a879e5f932213ea3c4fa398432e/weaviate/collections/classes/config.py#L1888

So, I believe I would need to auto-capitalize the first letter under by_ref_multi_target method also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug DX Developer and Contributor Experience
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants