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>
This commit is contained in:
bhatsanket 2024-12-19 13:00:00 -06:00 committed by GitHub
commit e657e9de4a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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: