From e657e9de4a001e0a0a8f38b73236d68eff971ccd Mon Sep 17 00:00:00 2001 From: bhatsanket Date: Thu, 19 Dec 2024 13:00:00 -0600 Subject: [PATCH] fix: fix partition error in AstraDBCQLToolComponent (#4356) * fix: AstraDBCQLToolComponent Tool part is working fine but the direct Data output fails cause of partition key issue * Ruff fix * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> --- .../base/langflow/components/tools/astradb_cql.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/backend/base/langflow/components/tools/astradb_cql.py b/src/backend/base/langflow/components/tools/astradb_cql.py index 5c2fa7dd0..04f1da824 100644 --- a/src/backend/base/langflow/components/tools/astradb_cql.py +++ b/src/backend/base/langflow/components/tools/astradb_cql.py @@ -94,15 +94,9 @@ class AstraDBCQLToolComponent(LCToolComponent): headers = {"Accept": "application/json", "X-Cassandra-Token": f"{self.token}"} astra_url = f"{self.api_endpoint}/api/rest/v2/keyspaces/{self.keyspace}/{self.table_name}/" key = [] + # Partition keys are mandatory - for k in self.partition_keys: - if k in args: - key.append(args[k]) - elif self.static_filters[k] is not None: - key.append(self.static_filters[k]) - else: - # TO-DO: Raise error - Missing information - key.append("none") + key = [self.partition_keys[k] for k in self.partition_keys] # Clustering keys are optional for k in self.clustering_keys: