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:
parent
2043b2f4f7
commit
22fa4cf088
1 changed files with 4 additions and 2 deletions
|
|
@ -49,7 +49,7 @@ class ClickhouseVectorStoreComponent(LCVectorStoreComponent):
|
||||||
value=False,
|
value=False,
|
||||||
advanced=True,
|
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),
|
DictInput(name="index_query_params", display_name="index query params", advanced=True),
|
||||||
*LCVectorStoreComponent.inputs,
|
*LCVectorStoreComponent.inputs,
|
||||||
HandleInput(name="embedding", display_name="Embedding", input_types=["Embeddings"]),
|
HandleInput(name="embedding", display_name="Embedding", input_types=["Embeddings"]),
|
||||||
|
|
@ -75,7 +75,9 @@ class ClickhouseVectorStoreComponent(LCVectorStoreComponent):
|
||||||
raise ImportError(msg) from e
|
raise ImportError(msg) from e
|
||||||
|
|
||||||
try:
|
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")
|
client.command("SELECT 1")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
msg = f"Failed to connect to Clickhouse: {e}"
|
msg = f"Failed to connect to Clickhouse: {e}"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue