Skip to content

Commit

Permalink
fix: Problem checking Clickhouse connection when port is different fr…
Browse files Browse the repository at this point in the history
…om 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>
  • Loading branch information
MarceloNunesAlves and autofix-ci[bot] authored Jan 30, 2025
1 parent 2043b2f commit 22fa4cf
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"]),
Expand All @@ -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}"
Expand Down

0 comments on commit 22fa4cf

Please sign in to comment.