Skip to content

"init_vector_store_table" function fails if optional parameter "metadata_columns" is not passed #98

@vmanghnani

Description

@vmanghnani

SpannerVectorStore.init_vector_store_table(

Environment details

Steps to reproduce

  1. Run : colab:  https://colab.sandbox.google.com/github/googleapis/langchain-google-spanner-python/blob/main/docs/vector_store.ipynb 
    
  2. In "SpannerVectorStore.init_vector_store_table" code cell, commentout "metadata_columns" parameter..
    cell's execution fails with below error: "...TypeError: 'NoneType' object is not iterable.."

Desired behavior: "metadata_columns" should be optional.. 

Code example

# example
------------------------------------------------------------------------------------------------------------------------------

from langchain_google_spanner import SecondaryIndex, SpannerVectorStore, TableColumn

SpannerVectorStore.init_vector_store_table(
    instance_id=INSTANCE,
    database_id=DATABASE,
    table_name=TABLE_NAME,
    # Customize the table creation
    id_column="row_id",
    #metadata_columns=[
    #    TableColumn(name="metadata", type="JSON", is_null=True),
    #    TableColumn(name="title", type="STRING(MAX)", is_null=False),
    #],
    secondary_indexes=[
        SecondaryIndex(index_name="row_id_and_title", columns=["row_id", "title"])
    ],
)------------------------------------------------------------------------------------------------------------------------------

Metadata

Metadata

Labels

api: spannerIssues related to the googleapis/langchain-google-spanner-python API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions