mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-24 12:41:02 +02:00
Filters should work
This commit is contained in:
parent
00032ad7bf
commit
dfab3e14e0
1 changed files with 11 additions and 1 deletions
|
|
@ -271,12 +271,22 @@ class Processor(FlowProcessor):
|
|||
info: Info,
|
||||
collection: str,
|
||||
limit: Optional[int] = 100,
|
||||
**filters
|
||||
where: Optional[str] = None # JSON string containing filter conditions
|
||||
) -> List[g_type]:
|
||||
# Get the processor instance from context
|
||||
processor = info.context["processor"]
|
||||
user = info.context["user"]
|
||||
|
||||
# Parse filters from where clause if provided
|
||||
filters = {}
|
||||
if where:
|
||||
try:
|
||||
import json
|
||||
filters = json.loads(where)
|
||||
except json.JSONDecodeError as e:
|
||||
# Invalid JSON, ignore filters
|
||||
filters = {}
|
||||
|
||||
# Query Cassandra
|
||||
results = await processor.query_cassandra(
|
||||
user, collection, s_name, r_schema,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue