From 22fa4cf0884e548f0ea8f800a088ff8394fb792a Mon Sep 17 00:00:00 2001 From: Marcelo Nunes Alves Date: Thu, 30 Jan 2025 18:14:08 -0300 Subject: [PATCH] fix: Problem checking Clickhouse connection when port is different from default (#5981) * fix: Problem checking clickhouse connection when port is different from default * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> --- .../base/langflow/components/vectorstores/clickhouse.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/backend/base/langflow/components/vectorstores/clickhouse.py b/src/backend/base/langflow/components/vectorstores/clickhouse.py index 4532f241c74d..f528d1955ef0 100644 --- a/src/backend/base/langflow/components/vectorstores/clickhouse.py +++ b/src/backend/base/langflow/components/vectorstores/clickhouse.py @@ -49,7 +49,7 @@ class ClickhouseVectorStoreComponent(LCVectorStoreComponent): value=False, advanced=True, ), - StrInput(name="index_param", display_name="Param of the index", value="'L2Distance',100", advanced=True), + StrInput(name="index_param", display_name="Param of the index", value="100,'L2Distance'", advanced=True), DictInput(name="index_query_params", display_name="index query params", advanced=True), *LCVectorStoreComponent.inputs, HandleInput(name="embedding", display_name="Embedding", input_types=["Embeddings"]), @@ -75,7 +75,9 @@ def build_vector_store(self) -> Clickhouse: raise ImportError(msg) from e try: - client = clickhouse_connect.get_client(host=self.host, username=self.username, password=self.password) + client = clickhouse_connect.get_client( + host=self.host, port=self.port, username=self.username, password=self.password + ) client.command("SELECT 1") except Exception as e: msg = f"Failed to connect to Clickhouse: {e}"