-
Notifications
You must be signed in to change notification settings - Fork 87
Open
Description
The afilter does not seem to work as described. Even using the example from the documentation does not work:
test.py
import dpath
import json
x = {
"a": {
"b": {
"3": 2,
"43": 30,
"c": "Waffles",
"d": "Waffles",
"e": {
"f": {
"g": "Roffle"
}
}
}
}
}
def afilter(x):
if "ffle" in str(x):
return True
return False
result = dpath.search(x, '**', afilter=afilter)
print(json.dumps(result, indent=4, sort_keys=True))Output
{
"a": {
"b": {
"3": 2,
"43": 30,
"c": "Waffles",
"d": "Waffles",
"e": {
"f": {
"g": "Roffle"
}
}
}
}
}It seems to be outputting ALL keys.
Metadata
Metadata
Assignees
Labels
No labels