mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-26 21:51:03 +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,
|
info: Info,
|
||||||
collection: str,
|
collection: str,
|
||||||
limit: Optional[int] = 100,
|
limit: Optional[int] = 100,
|
||||||
**filters
|
where: Optional[str] = None # JSON string containing filter conditions
|
||||||
) -> List[g_type]:
|
) -> List[g_type]:
|
||||||
# Get the processor instance from context
|
# Get the processor instance from context
|
||||||
processor = info.context["processor"]
|
processor = info.context["processor"]
|
||||||
user = info.context["user"]
|
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
|
# Query Cassandra
|
||||||
results = await processor.query_cassandra(
|
results = await processor.query_cassandra(
|
||||||
user, collection, s_name, r_schema,
|
user, collection, s_name, r_schema,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue