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

Can't create tables in own schema using engine.init_vectorstore_table #95

Open
MarkEdmondson1234 opened this issue Apr 3, 2024 · 1 comment
Labels
api: alloydb Issues related to the googleapis/langchain-google-alloydb-pg-python API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@MarkEdmondson1234
Copy link

I attempted to create a vector store like this:

...
          table_name = f"schema.table_name"
          engine.init_vectorstore_table(
              table_name,
              vector_size=vector_size,
              metadata_columns=[Column("source", "TEXT", nullable=True)],
              overwrite_existing=False
          )

Logs:

STATEMENT:  CREATE TABLE "myschema.my_table"(
            "langchain_id" UUID PRIMARY KEY,
            "content" TEXT NOT NULL,
            "embedding" vector(1536) NOT NULL,
"source" TEXT ,
"langchain_metadata" JSON
);
...
2024-04-03 10:58:08.074 UTC [1088933]: [2-1] db=db_multivac-internal-dev,user=sa-llmops@my-project.iam ERROR:  [aclchk.c:3655]  permission denied for schema public at character 14

It thinks its creating a table with a . in it within public schema.

I worked around by creating the table myself like this: in the alloydb studio client:

CREATE TABLE myschema.my_table (
            "langchain_id" UUID PRIMARY KEY,
            "content" TEXT NOT NULL,
            "embedding" vector(1536) NOT NULL,
"source" TEXT ,
"langchain_metadata" JSON
);

but it would be cool to be able to pass in the schema or something.

@product-auto-label product-auto-label bot added the api: alloydb Issues related to the googleapis/langchain-google-alloydb-pg-python API. label Apr 3, 2024
@averikitsch averikitsch added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. priority: p2 Moderately-important priority. Fix may not be included in next release. labels Apr 18, 2024
@jackwotherspoon
Copy link
Collaborator

@MarkEdmondson1234 This is a good feature request, currently the package tries to use the public schema when creating tables. We should allow users to specify schema directly, or like in your example if the table name includes a . in it to detect this as a table with schema specified (i.e. "my-schema.my-table" should assume schema="my-schema" and table= "my-table")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: alloydb Issues related to the googleapis/langchain-google-alloydb-pg-python API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

3 participants