You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary
I was using the Langchain C* class and noticed that if you accidentally use a string for the setup_mode, you'll get a cryptic error that you may end up debugging for too long 🙃 . I'm guessing it sneaks into the CQL create statement somehow?
repro
import cassio
from typing import Any, List, Optional, Union, Tuple
from langchain_community.vectorstores import Cassandra
from langchain_community.utilities.cassandra import SetupMode
from langchain_openai import OpenAIEmbeddings
database_id = "..."
token = "..."
table_name = "test"
def build():
cassio.init(
database_id=database_id,
token=token,
)
embedding = OpenAIEmbeddings(api_key="...")
table = Cassandra(
embedding=embedding,
table_name=table_name,
keyspace="default_keyspace",
setup_mode="Sync" # Accidentally had this as a string instead of SetupMode
# setup_mode=SetupMode.SYNC, # the correct param
)
res = table.search("random query", search_type="similarity")
print(res)
build()
Summary
I was using the Langchain C* class and noticed that if you accidentally use a string for the
setup_mode
, you'll get a cryptic error that you may end up debugging for too long 🙃 . I'm guessing it sneaks into the CQL create statement somehow?repro
Run this twice, and you'll see:
Versions
langchain 0.1.19
langchain-community 0.0.38
langchain-core 0.1.52
cassio 0.1.7
Python 3.11.2
The text was updated successfully, but these errors were encountered: