-
Notifications
You must be signed in to change notification settings - Fork 289
Description
setup_by_user=True leads to Exception: Setup for flow `TextEmbedding` is not up-to-date. Please run `cocoindex setup` to update the setup.
To Reproduce
-
cd examples/text_embedding -
cocoindex setup main(orupdate)Tables are successfully created.
-
Drop all tables except
TextEmbedding__doc_embeddings, which is supposed to be "setup by user" in the following steps, from the database (i.e.cocoindex_setup_metadataandTextEmbedding__cocoindex_tracking). -
Apply the patch below (add
setup_by_user=True)diff --git a/examples/text_embedding/main.py b/examples/text_embedding/main.py index 2f1acf6..3d107bc 100644 --- a/examples/text_embedding/main.py +++ b/examples/text_embedding/main.py @@ -71,6 +71,7 @@ def text_embedding_flow( metric=cocoindex.VectorSimilarityMetric.COSINE_SIMILARITY, ) ], + setup_by_user=True, )
-
Run
cocoindex setup mainagain.CocoIndex tries to recreate the tables that are removed by us previously, while
TextEmbedding__doc_embeddingsremains unchanged, which is expected, as it's still in the database and we've marked itsetup_by_user. -
Run
cocoindex update main.- ❌
Changes need to be pushed. Continue? [yes/N]:is printed, which is unexpected since we have just runcocoindex setup main. - ❌
Exception: Setup for flow `TextEmbedding` is not up-to-date. Please run `cocoindex setup` to update the setup.occured.
- ❌
Expected behavior
- Not being prompted to execute
cocoindex setupagain after it has already been executed. - More detailed error messages indicating why database changes are required (whether the tables need to be updated manually or
setupis indeed required).
CocoIndex Version
I've successfully reproduced in versions from 0.3.11 to 0.3.15


