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>
This commit is contained in:
Marcelo Nunes Alves 2025-01-30 18:14:08 -03:00 committed by GitHub
commit 22fa4cf088
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 @@ class ClickhouseVectorStoreComponent(LCVectorStoreComponent):
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}"