chroma-core / chroma

the AI-native open-source embedding database
https://www.trychroma.com/
Apache License 2.0
13.36k stars 1.14k forks source link

[Bug][DX]: New EF refactor breaks static analysis of imports for IDEs #2398

Open tazarov opened 1 week ago

tazarov commented 1 week ago

What happened?

The new refactoring of the EFs with dynamic imports #2034 breaks IDEs static analysis for imports. The dynamic imports work fine at runtime.

PyCharm

image

VSCode

image

Google Colab

Legacy import:

Screenshot 2024-06-21 at 11 00 52

New Import from EF file:

Screenshot 2024-06-21 at 11 00 28

Versions

Chroma@main

Relevant log output

No response

tazarov commented 1 week ago

cc @atroyn and @nablabits

atroyn commented 1 week ago

This is probably happening because of the way we do dynamic imports. I agree it's a bad user experience. @tazarov if you can take some time to see how this can be improved while retaining dynamic importing, that would be helpful. Maybe we need to populate __all__ ?

jeffchuber commented 5 days ago

@tazarov lmk if you can take a look! :)

tazarov commented 5 days ago

I'll have the PR up shortly.