feat: export private collection config types as public aliases - #2049
feat: export private collection config types as public aliases#2049LijuanTang94 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Infrastructure as Code | View in Orca | ||
| SAST | View in Orca | ||
| Secrets | View in Orca | ||
| Vulnerabilities | View in Orca |
|
To avoid any confusion in the future about your contribution to Weaviate, we work with a Contributor License Agreement. If you agree, you can simply add a comment to this PR that you agree with the CLA so that we can merge. |
|
I have read the CLA and agree to the terms. |
|
Hi team — just checking in on this PR. CLA is now signed and all checks are passing. Happy to make any changes if needed! |
Users annotating parameters like `generative_config`, `reranker_config`, `vector_index_config`, etc. had to import private `_`-prefixed types, which pyright strict mode (`reportPrivateUsage: error`) flags as an error. Adds public TypeAlias entries for the 8 affected types, following the same pattern as `FilterReturn` introduced in weaviate#1993: - GenerativeConfigCreate (_GenerativeProvider) - InvertedIndexConfigCreate (_InvertedIndexConfigCreate) - MultiTenancyConfigCreate (_MultiTenancyConfigCreate) - ObjectTTLConfigCreate (_ObjectTTLConfigCreate) - ReplicationConfigCreate (_ReplicationConfigCreate) - RerankerConfigCreate (_RerankerProvider) - ShardingConfigCreate (_ShardingConfigCreate) - VectorIndexConfigCreate (_VectorIndexConfigCreate) All 8 aliases are exported from `weaviate.classes.config`. Closes weaviate#1994
9929051 to
27e29d0
Compare
|
Rebased onto current Same CI situation as #2050: the Locally against current On the change: #1994 is still open, and this follows the same pattern as #1993 ( |
Summary
Closes #1994
Users who want to type-annotate parameters like
generative_config,reranker_config,vector_index_config, etc. incollection.create()currently have to import private_-prefixed types. In pyright strict mode (reportPrivateUsage: error) this is flagged as an error.This PR follows the exact same pattern as #1993 (
FilterReturn) and adds publicTypeAliasentries for the 8 affected types fromcollections/collections/executor.py:GenerativeConfigCreate_GenerativeProviderInvertedIndexConfigCreate_InvertedIndexConfigCreateMultiTenancyConfigCreate_MultiTenancyConfigCreateObjectTTLConfigCreate_ObjectTTLConfigCreateReplicationConfigCreate_ReplicationConfigCreateRerankerConfigCreate_RerankerProviderShardingConfigCreate_ShardingConfigCreateVectorIndexConfigCreate_VectorIndexConfigCreateAll 8 aliases are re-exported from
weaviate.classes.config.Before
After
Changes
weaviate/collections/classes/config.py— 6 newTypeAliasentriesweaviate/collections/classes/config_object_ttl.py— addTypeAliasimport + 1 aliasweaviate/collections/classes/config_vector_index.py— addTypeAliasimport + 1 aliasweaviate/classes/config.py— import and re-export all 8 aliases in__all__